AnyOf
提出詳細
type AnyOf<T extends any[]> = T extends [infer H, ...infer R] ? H extends Truthy ? true : AnyOf<R> : false
提出日時 | 2023-05-08 12:11:06 |
---|---|
問題 | AnyOf |
ユーザー | Dowanna |
ステータス | Wrong Answer |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<AnyOf<[1, 'test', true, [1], { name: 'test' }, { 1: 'test' }]>, true>>, Expect<Equal<AnyOf<[1, '', false, [], {}]>, true>>, Expect<Equal<AnyOf<[0, 'test', false, [], {}]>, true>>, Expect<Equal<AnyOf<[0, '', true, [], {}]>, true>>, Expect<Equal<AnyOf<[0, '', false, [1], {}]>, true>>, Expect<Equal<AnyOf<[0, '', false, [], { name: 'test' }]>, true>>, Expect<Equal<AnyOf<[0, '', false, [], { 1: 'test' }]>, true>>, Expect<Equal<AnyOf<[0, '', false, [], { name: 'test' }, { 1: 'test' }]>, true>>, Expect<Equal<AnyOf<[0, '', false, [], {}]>, false>>, Expect<Equal<AnyOf<[]>, false>>, ]