Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface JSON

Hierarchy

  • JSON

Index

Properties

Methods

Properties

[Symbol.toStringTag]

[Symbol.toStringTag]: string

Methods

parse

  • parse(text: string, reviver?: undefined | ((this: any, key: string, value: any) => any)): any
  • Converts a JavaScript Object Notation (JSON) string into an object.

    Parameters

    • text: string

      A valid JSON string.

    • Optional reviver: undefined | ((this: any, key: string, value: any) => any)

      A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.

    Returns any

stringify

  • stringify(value: any, replacer?: undefined | ((this: any, key: string, value: any) => any), space?: string | number): string
  • stringify(value: any, replacer?: (string | number)[] | null, space?: string | number): string
  • Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

    Parameters

    • value: any

      A JavaScript value, usually an object or array, to be converted.

    • Optional replacer: undefined | ((this: any, key: string, value: any) => any)

      A function that transforms the results.

    • Optional space: string | number

      Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

    Returns string

  • Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

    Parameters

    • value: any

      A JavaScript value, usually an object or array, to be converted.

    • Optional replacer: (string | number)[] | null

      An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.

    • Optional space: string | number

      Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

    Returns string