createStreamingDeAnonymizer
createStreamingDeAnonymizer(
redactor:PiiRedactor,emit: (chunk:string) =>void):object
Defined in: src/lib/pii/redactor.ts:655
Wraps an output sink so a streamed sequence of chunks is de-anonymized correctly even when a placeholder (“[EMAIL_1]”) is split across chunk boundaries — which happens routinely because the stream smoother emits text a few characters at a time.
Each push emits everything that is safe to restore now and holds back any
trailing fragment that could be the start of a placeholder (”[”, optionally
followed by placeholder-body characters) until it completes. Call flush
when the stream ends to emit whatever remains.
Parameters
| Parameter | Type |
|---|---|
|
| |
|
|
( |
Returns
object
flush()
flush: () =>
void
Returns
void
push()
push: (
chunk:string) =>void
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
void