Class JsonParser

Parses WebSocket messages after they have been transmitted. Some values, like dates, are automatically casted to type-specific objects.

Hierarchy

  • JsonParser

Constructors

Methods

  • Parameters

    • obj1: any
    • obj2: any

    Returns boolean

    true when the two objects are equal

    Deprecated

    Compares two objects.

  • Compares two objects.

    Parameters

    • obj1: any
    • obj2: any

    Returns boolean

    true when the two objects are equal

  • Generates a hash code for a string object.

    Parameters

    • s: string

      String for which the hash code should be generated

    Returns number

    the hash value of the string

  • Parses a JSON string into an object, applying value conversions using the parsing function.

    Parameters

    • str: string

      The JSON string to parse.

    Returns any

    The parsed object.

  • The parsing function used by JSON.parse() to handle specific value conversions.

    Parameters

    • key: any

      The key of the current property being parsed.

    • value: any

      The value of the current property being parsed.

    Returns any

    The parsed value, with dates casted to Date objects if applicable.

  • Converts an object to its JSON string representation.

    Parameters

    • obj: any

      The object to stringify.

    Returns string

    The JSON string representation of the object.

Generated using TypeDoc