Skip to content

SanitizeOptions

Defined in: safeStringify.ts:37

optional excludeKeys?: readonly string[] | Set<string>

Defined in: safeStringify.ts:39

Keys or dot-paths to completely exclude from the output (exact, case-sensitive match).


optional mode?: "json" | "clone"

Defined in: safeStringify.ts:51

Sanitization mode:

  • ‘json’: normalizes rich types (Date, Map, Set, Error) to JSON-friendly primitives/objects.
  • ‘clone’: deeply clones Date, RegExp, Map, Set, and binary values with their classes. An Error becomes a plain Error carrying its name, message, stack, and own enumerable properties; any other object becomes a plain object.

optional redactKeys?: readonly string[] | Set<string>

Defined in: safeStringify.ts:41

Keys or dot-paths to mask with REDACTED, matched ignoring case, _ and -.


optional redactReplacement?: string

Defined in: safeStringify.ts:43

Replacement string for redacted fields. Default: REDACTED.