• 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.

    Parameters

    Returns any

    either a new object with properties masked or an original object.

    Example

    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