• Takes a string and masks values in quotes if at least one keyword is present in value string.

    Parameters

    • Optional value: null | string

      string value to be masked.

    • Optional maskOptions: MaskOptions

      Options to determine how masking should be performed.

    Returns undefined | null | string

    either a masked string or an original string if keywords array is empty or undefined.

    Example

    const maskedString = defaultMaskMiddleware('Mask "this value" because string has a secret keyword', { keywords: ['secret'] });

    console.log(maskedString); //'Mask ****** because string has a secret keyword'

Generated using TypeDoc