Open sbyeol3 opened 2 years ago
type MyReadonly
type TupleToObject<T extends readonly any[]> = { [K in T[number]] : K }
type First<T extends any[]> = T extends []? never : T[0]
type Length<T extends readonly unknown[]> = T["length"]
type Concat<T extends any [], U extends any []> = [...T, ...U]
type Includes<T extends readonly any[], U> = T extends [infer F, ...infer R]? Equal<F, U> extends true? true : Includes<R, U> : false;
type Push<T extends any [], U> = [...T, U]
type Unshift<T extends any [], U> = [U, ...T]
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer A) => any? A : never;
4.Pick
type MyPick<T, K extends keyof T> = { //첫번째 인자의 key값들만 접근할 수 있도록 함 [P in K] : T[P] }