redactPii()
function redactPii<T>(data: T): T;
Redacts personally identifiable information (PII) from data objects. Removes sensitive data like credit cards, SSNs, emails, passwords, addresses, etc.
Type Parameters
T
T
Type of the data object
Parameters
data
T
Object containing potential PII to redact
Returns
T
New object with PII fields replaced with '****'
Example
const userData = {
name: 'John Doe',
email: 'john@example.com',
ssn: '123-45-6789',
address: '123 Main St'
};
const sanitized = redactPii(userData);
// {
// name: 'John Doe',
// email: '****',
// ssn: '****',
// address: '****'
// }