Optionaloptions: DataMaskingConstructorOptionsDecrypt data using the configured provider. Automatically detects full-payload (string input) vs field-level (object input) format.
Optionaloptions: DecryptOptionsEncrypt data using the configured provider. With fields, encrypts specific values in place. Without fields, encrypts the entire payload.
Optionaloptions: EncryptOptionsIrreversibly mask the entire payload with the default mask value: arrays element-wise preserving their length, and everything else with a single mask string.
The data to mask; returned as-is when null or undefined
Irreversibly mask fields in a data object. Returns a deep copy.
The options compose three layers (see EraseOptions):
regexPattern + maskFormat, dynamicMask,
or customMask) sets the default masking strategy;fields selects the paths to mask with that strategy — when omitted, a
top-level rule is applied to every leaf value in the payload;maskingRules provides per-field rules that take precedence over the
top-level rule for the paths they name.The data to mask; returned as-is when null or undefined
Options for the operation, see EraseOptions
Orchestrates erasing, encrypting, and decrypting sensitive data.
Example