holdanddeepdive / typescript-study

4 stars 0 forks source link

[3주차] Medium 2, 3, 8, 9, 10 #9

Open Choozii opened 1 year ago

Choozii commented 1 year ago
  1. type MyReturnType = T extends (...args:any) => infer Res? Res : never;

  2. type MyOmit<T, K extends keyof T> = {[P in Exclude<keyof T, K>] : T[P]}

  1. type TupleToObject<T extends readonly any[]> = { [P in T[number]] : P }

  2. type Length<T extends readonly string[]> = T["length"]