This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const viewKorean = (num: any): string => { | |
num = parseInt((num + '').replace(/[^0-9]/g, ''), 10) + ''; | |
if (num == '0') return '영'; | |
let number = ['영', '일', '이', '삼', '사', '오', '육', '칠', '팔', '구']; | |
let unit = ['', '만', '억', '조']; | |
let smallUnit = ['천', '백', '십', '']; | |
let result = []; | |
let unitCnt = Math.ceil(num.length / 4); | |
num = num.padStart(unitCnt * 4, '0'); | |
let regexp = /[\w\W]{4}/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function search(nameKey: any, myArray: any, attribute: string){ | |
for (let i=0; i < myArray.length; i++) { | |
if (myArray[i][attribute] === nameKey) { | |
return myArray[i]; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function emailSecurity(userEmail: string){ | |
const id = userEmail.split('@')[0]; | |
const mail = userEmail.split('@')[1]; | |
const maskingId = function(id: string) { | |
let splitId = id.substring(0,4); | |
for(let i = 4; i < id.length; i++) { | |
splitId += '*'; | |
} | |
return splitId; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function duplicateCheck(array: any[]) { | |
return array.reduce((t, a) => { | |
t[a] = (t[a] || 0) + 1; | |
return t | |
}, {}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const paginate = (array: any, index: any, size: any) => { | |
// transform values | |
index = Math.abs(parseInt(index)); | |
index = index > 0 ? index - 1 : index; | |
size = parseInt(size); | |
size = size < 1 ? 1 : size; | |
// filter | |
return [ | |
...array.filter((value: any, n: any) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Detail { | |
private link; | |
constructor(link) { | |
this.link = link; | |
} | |
public async detail(id: any): Promise { | |
return new Promise(async resolve => { |