JSON | typescript
Options
All
  • Public
  • Public/Protected
  • All
Menu

An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.

Hierarchy

  • JSON

Index

Methods

Methods

parse

  • parse(text: string, reviver?: function): any
  • Converts a JavaScript Object Notation (JSON) string into an object.

    Parameters

    • text: string

      A valid JSON string.

    • Optional reviver: function

      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.

        • (key: any, value: any): any
        • Parameters

          • key: any
          • value: any

          Returns any

    Returns any

stringify

  • stringify(value: any, replacer?: function, 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: function

      A function that transforms the results.

        • (key: string, value: any): any
        • Parameters

          • key: string
          • value: any

          Returns any

    • 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

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc