Deep-copies value with PII redacted: sensitive keys replaced by
"[scrubbed]", card-number-shaped strings masked to their last 4 digits,
circular references and over-deep nesting cut off safely.
Caveat: PAN masking applies to strings only. A card number carried as a JS
NUMBER under a key that isn't in the sensitive list passes through
unmasked — numbers are returned verbatim, so key-based redaction is the
only guard for numeric fields.
Deep-copies
valuewith PII redacted: sensitive keys replaced by "[scrubbed]", card-number-shaped strings masked to their last 4 digits, circular references and over-deep nesting cut off safely.Caveat: PAN masking applies to strings only. A card number carried as a JS NUMBER under a key that isn't in the sensitive list passes through unmasked — numbers are returned verbatim, so key-based redaction is the only guard for numeric fields.