This file contains hidden or 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
| import { EventEmitter } from 'events' | |
| export interface IEventSet { | |
| on(event: 'changed', listener: (name: string) => void): this | |
| on(event: 'deleted', listener: (name: string) => void): this | |
| } | |
| const MyEvent: EventEmitter & IEventSet = new EventEmitter() | |
| const myEvent = new MyEvent() |
This file contains hidden or 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
| import forge from 'node-forge' | |
| type encodingType = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined | |
| export const generateKeyPair = ( | |
| options: forge.pki.rsa.GenerateKeyPairOptions = { bits: 2048, workers: 2, e: 0x10001 } | |
| ): Promise<{ | |
| publicKey: string | |
| privateKey: string | |
| }> => { |
This file contains hidden or 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
| // ํ์ ์คํฌ๋ฆฝํธ ๊ธฐ๋ณธ๊ฐ์ข๋ ์๋๋ฅผ ์ฐธ์กฐํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค. | |
| // https://typescript-kr.github.io/pages/basic-types.html | |
| // ๊ธฐ๋ณธ ์์์ ๋๋ค. | |
| let a = 'blabla' | |
| // ํ์ ์คํฌ๋ฆฝํธ๋ฅผ ์ด์ฉํด์ | |
| // ๋ฌธ์์ด ํ์๋ง ๋ฃ์ ์ ์๋ | |
| // ๋ณ์๋ฅผ ์ ์ธํ ์์์ ๋๋ค. | |
| let b: string |
This file contains hidden or 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
| import { AxiosResponse } from 'axios' | |
| import axios from 'axios' | |
| /** | |
| * @description | |
| * A callback interface that contains the | |
| * communication code requested by the physical server. | |
| */ | |
| export type ProcessType = (link, header) => Promise<AxiosResponse<any>> |
This file contains hidden or 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
| /** | |
| * ๋ฐฐ์ด ์์ ๊ฒน์น๋ ๊ฐ์ ์ฐพ์๋ ๋๋ค. | |
| * @example | |
| * const some = ['1', '2', '3', '4', '5', '1', '1'] | |
| * console.log(checkDuplicatesInArray(some)) | |
| * // { '1': [ 0, 5, 6 ] } | |
| * @param items | |
| * @param isNeedFirstValue | |
| */ | |
| export const checkDuplicatesInArray = ( |
This file contains hidden or 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
| let target = `` // ์ฌ๊ธฐ ์์ ์ฝ๋๋ฅผ ๋ณต๋ถํด๋ฃ์ผ์ธ์. | |
| target = target.replace(/\/\//g, '\\/\\/') | |
| let codes = target.split('\n') | |
| let wrapped = '' | |
| for(let code of codes) wrapped += `"${code}",\n` | |
| console.log(wrapped) |
This file contains hidden or 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
| /*! | |
| diff v4.0.1 | |
| Software License Agreement (BSD License) | |
| Copyright (c) 2009-2015, Kevin Decker <[email protected]> | |
| All rights reserved. |
This file contains hidden or 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
| import { config, Group } from 'solapi' | |
| config.init({ | |
| apiKey: process.env.SMS_API_KEY, | |
| apiSecret: process.env.SMS_SECRET_KEY, | |
| }) | |
| export interface ISendSMSParam { | |
| /** | |
| * ๋ฌธ์ ๋ด์ฉ |
This file contains hidden or 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
| interface ITestObject { | |
| a: string | |
| b: number | |
| c: Function | |
| d: string[] | |
| } | |
| type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = | |
| Pick<T, Exclude<keyof T, Keys>> | |
| & { |
This file contains hidden or 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
| import fe1 from 'node-fe1-fpe' | |
| export interface IFPESetting { | |
| min: number | |
| max: number | |
| privateKey: string | |
| publicKey: string | |
| } | |
| export const encrypt = ({ |