Skip to content

Commit

Permalink
fix: Error Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss8981 committed Apr 13, 2022
1 parent f4af4be commit a05ccdb
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/checkBadLang.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function check(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/ /gi, '')
text = text.replace(/[^-]/gi, '')
Expand Down
2 changes: 2 additions & 0 deletions src/checkBelittle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function belittle(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(//gi, '년')
text = text.replace(//gi, '년')
Expand Down
2 changes: 2 additions & 0 deletions src/checkForeign.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function foreign(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^a-z]/gi, '')
if (text.includes(("fuck"))) {
Expand Down
2 changes: 2 additions & 0 deletions src/checkGeneral.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function general(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/ /gi, '')
text = text.replace(/[^-]/gi, '')
Expand Down
2 changes: 2 additions & 0 deletions src/checkMinor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function minor(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^-]/gi, '')
const sonofagun = ["개같", "개가튼", "개쉑", "개스키", "개세끼", "개색히", "개가뇬", "개새기", "개쌔기", "개쌔끼", "쌖", "쎆", "새긔", "개소리", "개년", "개소리",
Expand Down
2 changes: 2 additions & 0 deletions src/checkParents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function parents(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^-]/gi, '')
const your = ["ㄴㄱㅁ", "ㄴ금마", "느금ㅁ", "ㄴㄱ마", "ㄴㄱ빠", "ㄴ금빠"]
Expand Down
2 changes: 2 additions & 0 deletions src/checkPolitics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function politics(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^-]/gi, '')
const mh = ["노시개", "노알라", "뇌사모", "뇌물현"]
Expand Down
2 changes: 2 additions & 0 deletions src/checkRace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function race(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^-]/gi, '')
const nigger = ["깜둥이", "흑형","조센진","짱개","짱깨","짱께","짱게","쪽바리","쪽파리","빨갱이",]
Expand Down
2 changes: 2 additions & 0 deletions src/checkSexual.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function sexual(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
text = newtext.replace(/[^-]/gi, '')
text = text.replace(//gi, '')
Expand Down
2 changes: 2 additions & 0 deletions src/checkSpecial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function special(text: string|any): boolean {
if(!text) throw new Error('Korean: 확인할 텍스트를 입력해 주세요');
if(typeof text !== 'string') throw new Error('Korean: String 타입만 입력 가능합니다');
const newtext = text.toLowerCase()
const emoji = ["🖕🏻", "👌🏻👈🏻", "👉🏻👌🏻", "🤏🏻", "🖕", "🖕🏼", "🖕🏽", "🖕🏾", "🖕🏿"]
for (const i of emoji) {
Expand Down

0 comments on commit a05ccdb

Please sign in to comment.