Function: compileRedactor()
ts
function compileRedactor(config): RedactFn | undefined;Defined in: packages/core/src/presenter/RedactEngine.ts:138
Compile a redaction config into a V8-optimized redaction function.
The compiled function uses structuredClone to avoid mutating the original data (required for Late Guillotine: UI blocks and rules need the full unmasked data).
Parameters
| Parameter | Type | Description |
|---|---|---|
config | RedactConfig | Redaction configuration (paths + optional censor) |
Returns
RedactFn | undefined
A compiled RedactFn, or undefined if fast-redact is unavailable
Example
typescript
const redact = compileRedactor({
paths: ['*.ssn', 'credit_card.number'],
censor: '[REDACTED]',
});
if (redact) {
const safe = redact(sensitiveData);
// safe.ssn === '[REDACTED]'
}