원시 타입 또는 유니온 원시 타입인 Predicate과 Predicate의 요소로 포함되는 배열을 반환하고, 배열 T를 가지는 Filter<T, Predicate> 타입을 구현하세요.
import type { Equal, Expect } from '@type-challenges/utils'
type Falsy = false | 0 | '' | null | undefined
type cases = [
Expect<Equal<Filter<[0, 1, 2], 2>, [2]>>,
Expect<Equal<Filter<[0, 1, 2], 0 | 1>, [0, 1]>>,
Expect<Equal<Filter<[0, 1, 2], Falsy>, [0]>>,
]