SafeStringOption: {
    exclude: string | RegExp;
    replaceWith: string;
}

type containing an exclude field having either a string or RegExp used to identify characters or strings to be excluded and a replaceWith field containing a string to use as a replacement for each excluded value

Ex:

const opts = [{exclude: /[\s]+/g, replaceWith: '_'}];
convert.toSafeString('I am an example', opts); // returns 'I_am_an_example'

Type declaration

  • exclude: string | RegExp
  • replaceWith: string

Generated using TypeDoc