Type Challenges Judge

IsAny

提出詳細

type MyEqual<X,Y> = (<T>() => T extends X ? 0 : 1) extends (<U>() => U extends Y ? 0 : 1) ? true : false type IsAny<T> = MyEqual<any,T>
提出日時2023-09-19 05:24:03
問題IsAny
ユーザーsankantsu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<IsAny<any>, true>>, Expect<Equal<IsAny<undefined>, false>>, Expect<Equal<IsAny<unknown>, false>>, Expect<Equal<IsAny<never>, false>>, Expect<Equal<IsAny<string>, false>>, ]