BadWordsNext - alexzel/bad-words-next Wiki

Class: BadWordsNext

Main library class implementing profanity filtering and detection

Table of contents

Constructors

Methods

Constructors

constructor

new BadWordsNext(opts?)

Create an instance of BadWordsNext class

Parameters

Name Type
opts? Options

Defined in

index.ts:172

Methods

add

add(data): void

Add dictionary data for bad words filtering and detection

Parameters

Name Type Description
data Data Dictionary data

Returns

void

Defined in

index.ts:195


check

check(str): Boolean

Check whether the input string contains bad words or not

Parameters

Name Type
str string

Returns

Boolean

Defined in

index.ts:265


filter

filter(str): string

Filter bad words in the input string and replace them with a placeholder

Parameters

Name Type
str string

Returns

string

Defined in

index.ts:280