object to be masked.
Optional
maskOptions: MaskOptionseither a new object with properties masked or an original object.
const maskedObject = maskObject(
{
someSecret: 'Mask this',
propOne: 'Mask "this" secret',
propTwo: 'This is ok.',
},
{ keywords: ['secret'] },
);
console.log(maskedObject); //{someSecret: '******', propOne: 'Mask ****** secret', propTwo: 'This is ok.'}
Generated using TypeDoc
Takes an object, iterates over all properties and masks either the whole value of a property, if property name contains at least one of the keywords, or values in quotes if at least one keyword is present in value string. Masking of sub-object and array properties is supported.