DCS World Typescript
    Preparing search index...
    • Encodes a value as JSON text.

      • undefined/nil and NULL encode as null; booleans, numbers and strings as themselves (strings are treated as UTF-8 and passed through).
      • A table whose keys are all 1..n (holes allowed) is an array. One with string keys is an object; any positive integer keys beside them are written as strings, as JSON.stringify({ 1: "a", b: 2 }) does. Tables marked by asArray/asObject or produced by decode keep their kind.
      • A toJSON(key) method, if present, supplies the value to encode.

      Parameters

      Returns string

      For functions, userdata, threads, NaN, ±Infinity, circular references, keys that are neither strings nor positive integers, overly sparse arrays and nesting beyond maxDepth. The message includes the path to the offending value (with 0-based array indices), e.g. json.encode: cannot encode a value of type function at $.handlers[2].