[type-challenges] First of Array / Length of Tuple / Exclude
First of Array
설계 의도
빈 배열인 경우는 never 타입 리턴하고, 그 외는 배열의 첫 번째 요소 리턴하도록 구현
코드
type First<T extends any[]> = T extends [] ? never : T[0]
/* _____________ Test Cases _____________ */
import type { Equal, Expect } from '@type-challenges/utils'
type cas...
yarnmi.hashnode.dev2 min read