cuss-word-filter-ko
v1.2.0
Published
한국어 욕을 filtering 하는 모듈
Downloads
40
Maintainers
Readme
🏠 Homepage
😃 Npm
Installation
npm i cuss-word-filter-ko
Options
type CussWordFilterOptions = {
/**
* @default "./cuss-word-list.json" 에 있는 단어들
* @description 필터링할 단어들
*/
cussWords?: string[];
/**
* @default '*'
* @example '****'
*/
replacement?: string;
/**
* @default false
* @description default cussWords 와 constructor option 에서 전달된 cussWords 를 합칠지 여부
*/
mergeDefaultData?: boolean;
/**
* @default []
* @description 필터링을 제외할 단어들, isCussWord, filter method 에서 적용됨
*/
whiteList?: string[];
}
Usage
const { CussWordFilter } = require("cuss-word-filter-ko");
const filter = new CussWordFilter({});
console.log(filter.filter("ㅅㅂ 놈아")); // ** 놈아
or
import { CussWordFilter } from "cuss-word-filter-ko";
const filter = new CussWordFilter({});
console.log(filter.filter("ㅅㅂ 놈아")); // ** 놈아
Test Coverage
Contributing
Contributions, issues and feature requests are welcome!
License
MIT