Function safeJsonStringify

  • JSON.stringify replacement that

    • handles circular references
    • always returns a string even if primitives are passed
    • the input value is always the exact same output value when deserialized (for supported types)
    • supportes ALL primitive types including NaN, Infinity, -Infinity
    • supports all object types including Date, Set, Map To deserialize the stringified object, use

    Parameters

    • value: unknown

      The value to convert to a JSON string.

    • indent: number = 0

      The string or number used to insert white space into the output JSON string for readability purposes.

    Returns string

    A JSON string representing the given value.

    See

    • safeJsonParse. To register custom class types, use
    • registerClass.

Generated using TypeDoc