maskArray
Deep-walk an array and mask all string values containing PII.
Usage
import { createMasker } from '@pii-mask/core';
const masker = createMasker({ mode: 'redact' });
const { result } = masker.maskArray([
{ email: 'emeka@example.com', phone: '+2348012345678' },
{ email: 'priya@example.com', phone: '+919876543210' },
]);
console.log(JSON.parse(result));
// → [
// { email: '[REDACTED]', phone: '[REDACTED]' },
// { email: '[REDACTED]', phone: '[REDACTED]' },
// ]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | unknown[] | Yes | The array to deep-walk and mask |
session | MaskSession | No | Session for cross-call consistency (shared tokens/labels) |