한국어 욕설을 바꿔주는 간단한 모듈
🏠 Homepage
😃 Npm
npm i cuss-word-filter-ko
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[];
}
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("ㅅㅂ 놈아")); // ** 놈아
Contributions, issues and feature requests are welcome!
MIT