Interface FilterOptions

Constructor options for Filter class.

interface FilterOptions {
    emptyList?: boolean;
    exclude?: string[];
    list?: string[];
    placeHolder?: string;
    regex?: RegExp;
    replaceRegex?: RegExp;
    splitRegex?: RegExp;
}

Properties

emptyList?: boolean

Instantiate filter with no blocklist

exclude?: string[]
list?: string[]

Instantiate filter with custom list

placeHolder?: string

Character used to replace profane words.

regex?: RegExp

Regular expression used to sanitize words before comparing them to blocklist.

replaceRegex?: RegExp

Regular expression used to replace profane words with placeHolder.

splitRegex?: RegExp

Regular expression used to split a string into words.