IsNever
提出詳細
type IsNever<T> = (<P>()=>P extends T ? 1 : 2) extends (<P>()=>P extends never ? 1 : 2) ? true : false
提出日時 | 2023-04-29 10:48:04 |
---|---|
問題 | IsNever |
ユーザー | kagankan |
ステータス | Accepted |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<IsNever<never>, true>>, Expect<Equal<IsNever<never | string>, false>>, Expect<Equal<IsNever<''>, false>>, Expect<Equal<IsNever<undefined>, false>>, Expect<Equal<IsNever<null>, false>>, Expect<Equal<IsNever<[]>, false>>, Expect<Equal<IsNever<{}>, false>>, ]