Interface SerializerOptions

Main serializer options

interface SerializerOptions {
    allowedTypes?: readonly string[];
    allowUnsafeRegExp?: boolean;
    maxDepth?: number;
    maxRegExpPatternLength?: number;
    pretty?: boolean;
    symbolPolicy?: SymbolPolicy;
}

Properties

allowedTypes?: readonly string[]

Restrict deserialization to this list of type IDs

allowUnsafeRegExp?: boolean

Allow RegExp patterns that fail the safety heuristic

maxDepth?: number

Maximum recursion depth allowed during serialize/deserialize

maxRegExpPatternLength?: number

Maximum accepted RegExp pattern length during deserialization

pretty?: boolean

Whether to pretty-print JSON (for debugging)

symbolPolicy?: SymbolPolicy

Controls which Symbol payloads may be deserialized