interface JsonOptions {
    bigint?: boolean;
    circularValue?: null | string | ErrorConstructor | TypeErrorConstructor;
    deterministic?: boolean;
    maximumBreadth?: number;
    maximumDepth?: number;
    replacer?: ((this, key, value) => any);
    space?: number;
}

Properties

bigint?: boolean

If true, bigint values are converted to a number. Otherwise, they are ignored. This option is ignored by default as Logform stringifies BigInt in the default replacer.

Default

true
circularValue?: null | string | ErrorConstructor | TypeErrorConstructor

Defines the value for circular references. Set to undefined, circular properties are not serialized (array entries are replaced with null). Set to Error, to throw on circular references.

Default

"[Circular]"
deterministic?: boolean

If true, guarantee a deterministic key order instead of relying on the insertion order.

Default

true
maximumBreadth?: number

Maximum number of entries to serialize per object (at least one). The serialized output contains information about how many entries have not been serialized. Ignored properties are counted as well (e.g., properties with symbol values). Using the array replacer overrules this option.

Default

Infinity
maximumDepth?: number

Maximum number of object nesting levels (at least 1) that will be serialized. Objects at the maximum level are serialized as "[Object]" and arrays as "[Array]".

Default

Infinity
replacer?: ((this, key, value) => any)

A function that influences how the info is stringified.

Type declaration

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

      • this: any
      • key: string
      • value: any

      Returns any

space?: number

The number of white space used to format the json.