DCS World Typescript
    Preparing search index...
    • Parses JSON text.

      Strict RFC 8259: no comments, trailing commas, single quotes, leading zeros, NaN/Infinity or unescaped control characters. \uXXXX escapes become UTF-8, surrogate pairs are combined and unpaired surrogates become U+FFFD. Duplicate keys keep the last value. Numbers too large for a double become ±math.huge, as in JavaScript.

      Type Parameters

      • T = unknown

        The expected shape. This is not checked at runtime.

      Parameters

      • text: string

        The JSON text.

      • Optionaloptions: DecodeOptions

        nullValue and maxDepth.

      Returns T

      If the text is not valid JSON; the message gives the line and column, e.g. json.decode: expected ',' or '}' but found ']' at line 3 column 7.