PiiRedactorOptions
Defined in: src/lib/pii/redactor.ts:15
Options for constructing a PiiRedactor. Lets apps disable noisy built-in categories or supply their own detection patterns.
Properties
excludeCategories?
optionalexcludeCategories: (string&object|PiiCategory)[]
Defined in: src/lib/pii/redactor.ts:31
Built-in categories to disable, e.g. the higher-false-positive
["US_ADDRESS", "DATE_OF_BIRTH"]. Ignored when patterns is provided.
extraPatterns?
optionalextraPatterns:PiiPattern[]
Defined in: src/lib/pii/redactor.ts:26
Additional patterns appended after the (optionally filtered) built-ins.
Ignored when patterns is provided.
nerDetector?
optionalnerDetector:NerDetector
Defined in: src/lib/pii/redactor.ts:41
Optional named-entity detector for unstructured PII (person names,
locations, organizations) that regex cannot find. When supplied, the
async redaction methods (redactTextAsync / maskTextAsync /
redactMessagesAsync) merge its spans with the regex matches; the
synchronous methods ignore it and stay regex-only. The regex layer always
wins on overlap, so structured PII detection stays deterministic. See
NerDetector.
patterns?
optionalpatterns:PiiPattern[]
Defined in: src/lib/pii/redactor.ts:21
Replace the entire default pattern set. When set, extraPatterns and
excludeCategories are ignored. Order matters — more specific patterns
should come first (see PII_PATTERNS).