From 91a42ae08552815c3ef3299fbe8bcc86b0ddff49 Mon Sep 17 00:00:00 2001 From: Tanat <85154556+Tanat05@users.noreply.github.com> Date: Sun, 12 Jun 2022 21:33:59 +0900 Subject: [PATCH] Update checkBelittle.ts --- src/checkBelittle.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/checkBelittle.ts b/src/checkBelittle.ts index 05bf165..3eb6072 100644 --- a/src/checkBelittle.ts +++ b/src/checkBelittle.ts @@ -2,6 +2,17 @@ export function belittle(text: string | any): boolean { if (!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요'); if (typeof text !== 'string') throw new Error('Korcen: String 타입만 입력 가능합니다'); const newtext = text.toLowerCase() + + text = newtext.replace(/뇬/gi, '련') + text = text.replace(/놈/gi, '련') + text = text.replace(/넘/gi, '련') + const belittling2 = ["10련"] + for (const i of belittling2) { + if (text.includes(i)) { + return true; + } + } + text = newtext.replace(/련/gi, '년') text = text.replace(/뇬/gi, '년') text = text.replace(/놈/gi, '년')