[TS] 조건부 타입과 infer를 활용한 타입 추론 연습
TIL
1. 조건을 만족하는 IsProductKey 타입 완성IsProductKey 타입- T가 Product의 key 중 하나일 경우 결과는 true 타입- T가 Product의 key 중 하나가 아닐 경우 결과는 false 타입interface Product { id: number; name: string; price: number; seller: { id: number; name: string; company: string; };}type IsProductKey = any;type IsProductKey = T extends keyof Product ? true: false; 2. 조건을 만족하는 Extract 타입 구현Extract- T로부터 U만 추출하는 타입type Extr..