repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00002-medium-return-type/template.ts
questions/00002-medium-return-type/template.ts
type MyReturnType<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03243-medium-flattendepth/test-cases.ts
questions/03243-medium-flattendepth/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<FlattenDepth<[]>, []>>, Expect<Equal<FlattenDepth<[1, 2, 3, 4]>, [1, 2, 3, 4]>>, Expect<Equal<FlattenDepth<[1, [2]]>, [1, 2]>>, Expect<Equal<FlattenDepth<[1, 2, [3, 4], [[[5]]]], 2>, [1, 2, 3, 4, [5]]>>, Expect<Equal<Flat...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03243-medium-flattendepth/template.ts
questions/03243-medium-flattendepth/template.ts
type FlattenDepth = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/21106-medium-zu-he-jian-lei-xing-combination-key-type/test-cases.ts
questions/21106-medium-zu-he-jian-lei-xing-combination-key-type/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type ModifierKeys = ['cmd', 'ctrl', 'opt', 'fn'] type CaseTypeOne = 'cmd ctrl' | 'cmd opt' | 'cmd fn' | 'ctrl opt' | 'ctrl fn' | 'opt fn' type cases = [ Expect<Equal<Combs<ModifierKeys>, CaseTypeOne>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/21106-medium-zu-he-jian-lei-xing-combination-key-type/template.ts
questions/21106-medium-zu-he-jian-lei-xing-combination-key-type/template.ts
// 实现 Combs type Combs<T extends any[]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00741-extreme-sort/test-cases.ts
questions/00741-extreme-sort/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Sort<[]>, []>>, Expect<Equal<Sort<[1]>, [1]>>, Expect<Equal<Sort<[2, 1]>, [1, 2]>>, Expect<Equal<Sort<[0, 0, 0]>, [0, 0, 0]>>, Expect<Equal<Sort<[1, 2, 3]>, [1, 2, 3]>>, Expect<Equal<Sort<[3, 2, 1]>, [1, 2, 3]>>, Expe...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00741-extreme-sort/template.ts
questions/00741-extreme-sort/template.ts
type Sort = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09286-medium-firstuniquecharindex/test-cases.ts
questions/09286-medium-firstuniquecharindex/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<FirstUniqueCharIndex<'leetcode'>, 0>>, Expect<Equal<FirstUniqueCharIndex<'loveleetcode'>, 2>>, Expect<Equal<FirstUniqueCharIndex<'aabb'>, -1>>, Expect<Equal<FirstUniqueCharIndex<''>, -1>>, Expect<Equal<FirstUniqueCharInde...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09286-medium-firstuniquecharindex/template.ts
questions/09286-medium-firstuniquecharindex/template.ts
type FirstUniqueCharIndex<T extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00462-extreme-currying-2/test-cases.ts
questions/00462-extreme-currying-2/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' const curried1 = DynamicParamsCurrying((a: string, b: number, c: boolean) => true) const curried2 = DynamicParamsCurrying((a: string, b: number, c: boolean, d: boolean, e: boolean, f: string, g: boolean) => true) const curried1Return1 = curried1('123')(123)(...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00462-extreme-currying-2/template.ts
questions/00462-extreme-currying-2/template.ts
declare function DynamicParamsCurrying(fn: any): any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00734-extreme-inclusive-range/test-cases.ts
questions/00734-extreme-inclusive-range/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<InclusiveRange<200, 1>, []>>, Expect<Equal<InclusiveRange<10, 5>, []>>, Expect<Equal<InclusiveRange<5, 5>, [5]>>, Expect<Equal<InclusiveRange<0, 10>, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]>>, Expect<Equal<InclusiveRange<1, 20...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00734-extreme-inclusive-range/template.ts
questions/00734-extreme-inclusive-range/template.ts
type InclusiveRange<Lower extends number, Higher extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00651-hard-length-of-string-2/test-cases.ts
questions/00651-hard-length-of-string-2/test-cases.ts
import type { Equal, IsTrue } from '@type-challenges/utils' type cases = [ IsTrue<Equal<LengthOfString<''>, 0>>, IsTrue<Equal<LengthOfString<'1'>, 1>>, IsTrue<Equal<LengthOfString<'12'>, 2>>, IsTrue<Equal<LengthOfString<'123'>, 3>>, IsTrue<Equal<LengthOfString<'1234'>, 4>>, IsTrue<Equal<LengthOfString<'123...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00651-hard-length-of-string-2/template.ts
questions/00651-hard-length-of-string-2/template.ts
type LengthOfString<S extends string> = number
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00007-easy-readonly/test-cases.ts
questions/00007-easy-readonly/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<MyReadonly<Todo1>, Readonly<Todo1>>>, ] interface Todo1 { title: string description: string completed: boolean meta: { author: string } }
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00007-easy-readonly/template.ts
questions/00007-easy-readonly/template.ts
type MyReadonly<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/13580-hard-replace-union/test-cases.ts
questions/13580-hard-replace-union/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ // string -> null Expect<Equal<UnionReplace<number | string, [[string, null]]>, number | null>>, // string -> null Expect<Equal<UnionReplace<number | string, [[string, null], [Date, Function]]>, number | null>>, // Date -> string; F...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/13580-hard-replace-union/template.ts
questions/13580-hard-replace-union/template.ts
type UnionReplace<T, U extends [any, any][]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03188-medium-tuple-to-nested-object/test-cases.ts
questions/03188-medium-tuple-to-nested-object/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<TupleToNestedObject<['a'], string>, { a: string }>>, Expect<Equal<TupleToNestedObject<['a', 'b'], number>, { a: { b: number } }>>, Expect<Equal<TupleToNestedObject<['a', 'b', 'c'], boolean>, { a: { b: { c: boolean } } }>>, ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03188-medium-tuple-to-nested-object/template.ts
questions/03188-medium-tuple-to-nested-object/template.ts
type TupleToNestedObject<T, U> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/25270-medium-transpose/test-cases.ts
questions/25270-medium-transpose/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Transpose<[]>, []>>, Expect<Equal<Transpose<[[1]]>, [[1]]>>, Expect<Equal<Transpose<[[1, 2]]>, [[1], [2]]>>, Expect<Equal<Transpose<[[1, 2], [3, 4]]>, [[1, 3], [2, 4]]>>, Expect<Equal<Transpose<[[1, 2, 3], [4, 5, 6]]>, [[...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/25270-medium-transpose/template.ts
questions/25270-medium-transpose/template.ts
type Transpose<M extends number[][]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30178-hard-unique-items/test-cases.ts
questions/30178-hard-unique-items/test-cases.ts
import type { Equal } from '@type-challenges/utils' declare const readonlyEqual: <A>() => <T>(value: T) => Equal<Readonly<A>, Readonly<T>> declare const expect: (value: true) => void // Should work expect(readonlyEqual<[1, 2, 3]>()(uniqueItems([1, 2, 3]))) expect(readonlyEqual<['a', 'b', 'c']>()(uniqueItems(['a', 'b'...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30178-hard-unique-items/template.ts
questions/30178-hard-unique-items/template.ts
function uniqueItems(items: any[]) { return items }
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05310-medium-join/test-cases.ts
questions/05310-medium-join/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Join<['a', 'p', 'p', 'l', 'e'], '-'>, 'a-p-p-l-e'>>, Expect<Equal<Join<['Hello', 'World'], ' '>, 'Hello World'>>, Expect<Equal<Join<['2', '2', '2'], 1>, '21212'>>, Expect<Equal<Join<['o'], 'u'>, 'o'>>, Expect<Equal<Join<[...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05310-medium-join/template.ts
questions/05310-medium-join/template.ts
type Join<T, U> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/01097-medium-isunion/test-cases.ts
questions/01097-medium-isunion/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<IsUnion<string>, false>>, Expect<Equal<IsUnion<string | number>, true>>, Expect<Equal<IsUnion<'a' | 'b' | 'c' | 'd'>, true>>, Expect<Equal<IsUnion<undefined | null | void | ''>, true>>, Expect<Equal<IsUnion<{ a: string } ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/01097-medium-isunion/template.ts
questions/01097-medium-isunion/template.ts
type IsUnion<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00057-hard-get-required/test-cases.ts
questions/00057-hard-get-required/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<GetRequired<{ foo: number, bar?: string }>, { foo: number }>>, Expect<Equal<GetRequired<{ foo: undefined, bar?: undefined }>, { foo: undefined }>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00057-hard-get-required/template.ts
questions/00057-hard-get-required/template.ts
type GetRequired<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00847-hard-string-join/test-cases.ts
questions/00847-hard-string-join/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' // Edge cases const noCharsOutput = join('-')() const oneCharOutput = join('-')('a') const noDelimiterOutput = join('')('a', 'b', 'c') // Regular cases const hyphenOutput = join('-')('a', 'b', 'c') const hashOutput = join('#')('a', 'b', 'c') const twoCharOut...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00847-hard-string-join/template.ts
questions/00847-hard-string-join/template.ts
declare function join(delimiter: any): (...parts: any[]) => any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00274-extreme-integers-comparator/test-cases.ts
questions/00274-extreme-integers-comparator/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Comparator<5, 5>, Comparison.Equal>>, Expect<Equal<Comparator<5, 6>, Comparison.Lower>>, Expect<Equal<Comparator<5, 8>, Comparison.Lower>>, Expect<Equal<Comparator<5, 0>, Comparison.Greater>>, Expect<Equal<Comparator<-5, ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00274-extreme-integers-comparator/template.ts
questions/00274-extreme-integers-comparator/template.ts
enum Comparison { Greater, Equal, Lower, } type Comparator<A extends number, B extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/07544-medium-construct-tuple/test-cases.ts
questions/07544-medium-construct-tuple/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<ConstructTuple<0>, []>>, Expect<Equal<ConstructTuple<2>, [unknown, unknown]>>, Expect<Equal<ConstructTuple<999>['length'], 999>>, // @ts-expect-error Expect<Equal<ConstructTuple<1000>['length'], 1000>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/07544-medium-construct-tuple/template.ts
questions/07544-medium-construct-tuple/template.ts
type ConstructTuple<L extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/16259-medium-to-primitive/test-cases.ts
questions/16259-medium-to-primitive/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type PersonInfo = { name: 'Tom' age: 30 married: false addr: { home: '123456' phone: '13111111111' } hobbies: ['sing', 'dance'] readonlyArr: readonly ['test'] fn: () => any } type ExpectedResult = { name: string age: number marr...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/16259-medium-to-primitive/template.ts
questions/16259-medium-to-primitive/template.ts
type ToPrimitive = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00956-hard-deeppick/test-cases.ts
questions/00956-hard-deeppick/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type Obj = { a: number b: string c: boolean obj: { d: number e: string f: boolean obj2: { g: number h: string i: boolean } } obj3: { j: number k: string l: boolean } } type cases = [ Expect<Eq...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00956-hard-deeppick/template.ts
questions/00956-hard-deeppick/template.ts
type DeepPick = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/04803-medium-trim-right/test-cases.ts
questions/04803-medium-trim-right/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<TrimRight<'str'>, 'str'>>, Expect<Equal<TrimRight<'str '>, 'str'>>, Expect<Equal<TrimRight<'str '>, 'str'>>, Expect<Equal<TrimRight<' str '>, ' str'>>, Expect<Equal<TrimRight<' foo bar \n\t '>, ' foo ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/04803-medium-trim-right/template.ts
questions/04803-medium-trim-right/template.ts
type TrimRight<S extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00553-hard-deep-object-to-unique/test-cases.ts
questions/00553-hard-deep-object-to-unique/test-cases.ts
import type { Equal, IsFalse, IsTrue } from '@type-challenges/utils' type Quz = { quz: 4 } type Foo = { foo: 2, baz: Quz, bar: Quz } type Bar = { foo: 2, baz: Quz, bar: Quz & { quzz?: 0 } } type UniqQuz = DeepObjectToUniq<Quz> type UniqFoo = DeepObjectToUniq<Foo> type UniqBar = DeepObjectToUniq<Bar> declare let foo...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00553-hard-deep-object-to-unique/template.ts
questions/00553-hard-deep-object-to-unique/template.ts
type DeepObjectToUniq<O extends object> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/18142-medium-all/test-cases.ts
questions/18142-medium-all/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<All<[1, 1, 1], 1>, true>>, Expect<Equal<All<[1, 1, 2], 1>, false>>, Expect<Equal<All<['1', '1', '1'], '1'>, true>>, Expect<Equal<All<['1', '1', '1'], 1>, false>>, Expect<Equal<All<[number, number, number], number>, true>>...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/18142-medium-all/template.ts
questions/18142-medium-all/template.ts
type All = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/01130-medium-replacekeys/test-cases.ts
questions/01130-medium-replacekeys/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type NodeA = { type: 'A' name: string flag: number } type NodeB = { type: 'B' id: number flag: number } type NodeC = { type: 'C' name: string flag: number } type ReplacedNodeA = { type: 'A' name: number flag: string } type Replaced...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/01130-medium-replacekeys/template.ts
questions/01130-medium-replacekeys/template.ts
type ReplaceKeys<U, T, Y> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02257-medium-minusone/test-cases.ts
questions/02257-medium-minusone/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<MinusOne<1>, 0>>, Expect<Equal<MinusOne<55>, 54>>, Expect<Equal<MinusOne<3>, 2>>, Expect<Equal<MinusOne<100>, 99>>, Expect<Equal<MinusOne<1101>, 1100>>, Expect<Equal<MinusOne<9_007_199_254_740_992>, 9_007_199_254_740_99...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02257-medium-minusone/template.ts
questions/02257-medium-minusone/template.ts
type MinusOne<T extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05140-medium-trunc/test-cases.ts
questions/05140-medium-trunc/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Trunc<0.1>, '0'>>, Expect<Equal<Trunc<0.2>, '0'>>, Expect<Equal<Trunc<1.234>, '1'>>, Expect<Equal<Trunc<12.345>, '12'>>, Expect<Equal<Trunc<-5.1>, '-5'>>, Expect<Equal<Trunc<'.3'>, '0'>>, Expect<Equal<Trunc<'1.234'>, ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05140-medium-trunc/template.ts
questions/05140-medium-trunc/template.ts
type Trunc = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00012-medium-chainable-options/test-cases.ts
questions/00012-medium-chainable-options/test-cases.ts
import type { Alike, Expect } from '@type-challenges/utils' declare const a: Chainable const result1 = a .option('foo', 123) .option('bar', { value: 'Hello World' }) .option('name', 'type-challenges') .get() const result2 = a .option('name', 'another name') // @ts-expect-error .option('name', 'last nam...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00012-medium-chainable-options/template.ts
questions/00012-medium-chainable-options/template.ts
type Chainable = { option(key: string, value: any): any get(): any }
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05317-medium-lastindexof/test-cases.ts
questions/05317-medium-lastindexof/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<LastIndexOf<[1, 2, 3, 2, 1], 2>, 3>>, Expect<Equal<LastIndexOf<[2, 6, 3, 8, 4, 1, 7, 3, 9], 3>, 7>>, Expect<Equal<LastIndexOf<[0, 0, 0], 2>, -1>>, Expect<Equal<LastIndexOf<[string, 2, number, 'a', number, 1], number>, 4>>, ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/05317-medium-lastindexof/template.ts
questions/05317-medium-lastindexof/template.ts
type LastIndexOf<T, U> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09384-hard-maximum/test-cases.ts
questions/09384-hard-maximum/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Maximum<[]>, never>>, Expect<Equal<Maximum<[0, 2, 1]>, 2>>, Expect<Equal<Maximum<[1, 20, 200, 150]>, 200>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09384-hard-maximum/template.ts
questions/09384-hard-maximum/template.ts
type Maximum<T extends any[]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00043-easy-exclude/test-cases.ts
questions/00043-easy-exclude/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<MyExclude<'a' | 'b' | 'c', 'a'>, 'b' | 'c'>>, Expect<Equal<MyExclude<'a' | 'b' | 'c', 'a' | 'b'>, 'c'>>, Expect<Equal<MyExclude<string | number | (() => void), Function>, string | number>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00043-easy-exclude/template.ts
questions/00043-easy-exclude/template.ts
type MyExclude<T, U> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30301-medium-isodd/test-cases.ts
questions/30301-medium-isodd/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<IsOdd<5>, true>>, Expect<Equal<IsOdd<2023>, true>>, Expect<Equal<IsOdd<1453>, true>>, Expect<Equal<IsOdd<1926>, false>>, Expect<Equal<IsOdd<2.3>, false>>, Expect<Equal<IsOdd<3e23>, false>>, Expect<Equal<IsOdd<3e0>, tr...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30301-medium-isodd/template.ts
questions/30301-medium-isodd/template.ts
type IsOdd<T extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00545-hard-printf/test-cases.ts
questions/00545-hard-printf/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Format<'abc'>, string>>, Expect<Equal<Format<'a%sbc'>, (s1: string) => string>>, Expect<Equal<Format<'a%dbc'>, (d1: number) => string>>, Expect<Equal<Format<'a%%dbc'>, string>>, Expect<Equal<Format<'a%%%dbc'>, (d1: number...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00545-hard-printf/template.ts
questions/00545-hard-printf/template.ts
type Format<T extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00011-easy-tuple-to-object/test-cases.ts
questions/00011-easy-tuple-to-object/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const const tupleNumber = [1, 2, 3, 4] as const const sym1 = Symbol(1) const sym2 = Symbol(2) const tupleSymbol = [sym1, sym2] as const const tupleMix = [1, '2', 3, '4', sym1] as const type cases = ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00011-easy-tuple-to-object/template.ts
questions/00011-easy-tuple-to-object/template.ts
type TupleToObject<T extends readonly any[]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00189-easy-awaited/test-cases.ts
questions/00189-easy-awaited/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type X = Promise<string> type Y = Promise<{ field: number }> type Z = Promise<Promise<string | number>> type Z1 = Promise<Promise<Promise<string | boolean>>> type T = { then: (onfulfilled: (arg: number) => any) => any } type cases = [ Expect<Equal<MyAwaite...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00189-easy-awaited/template.ts
questions/00189-easy-awaited/template.ts
type MyAwaited<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02693-medium-endswith/test-cases.ts
questions/02693-medium-endswith/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<EndsWith<'abc', 'bc'>, true>>, Expect<Equal<EndsWith<'abc', 'abc'>, true>>, Expect<Equal<EndsWith<'abc', 'd'>, false>>, Expect<Equal<EndsWith<'abc', 'ac'>, false>>, Expect<Equal<EndsWith<'abc', ''>, true>>, Expect<Equal...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02693-medium-endswith/template.ts
questions/02693-medium-endswith/template.ts
type EndsWith<T extends string, U extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30958-medium-pascals-triangle/test-cases.ts
questions/30958-medium-pascals-triangle/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect< Equal< Pascal<1>, [ [1], ] > >, Expect< Equal< Pascal<3>, [ [1], [1, 1], [1, 2, 1], ] > >, Expect< Equal< Pascal<5>, [ ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/30958-medium-pascals-triangle/template.ts
questions/30958-medium-pascals-triangle/template.ts
type Pascal<N extends number> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/29650-medium-extracttoobject/test-cases.ts
questions/29650-medium-extracttoobject/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type test1 = { id: '1', myProp: { foo: '2' } } type testExpect1 = { id: '1' foo: '2' } type test2 = { id: '1' prop1: { zoo: '2' } prop2: { foo: '4' } } type testExpect2 = { id: '1' prop1: { zoo: '2' } foo: '4' } type test3 = { prop1: { z...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/29650-medium-extracttoobject/template.ts
questions/29650-medium-extracttoobject/template.ts
type ExtractToObject<T, U> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/31447-extreme-countreversepairs/test-cases.ts
questions/31447-extreme-countreversepairs/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<CountReversePairs<[5, 2, 6, 1]>, 4>>, Expect<Equal<CountReversePairs<[1, 2, 3, 4]>, 0>>, Expect<Equal<CountReversePairs<[-1, -1]>, 0>>, Expect<Equal<CountReversePairs<[-1]>, 0>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/31447-extreme-countreversepairs/template.ts
questions/31447-extreme-countreversepairs/template.ts
type CountReversePairs<T extends number[]> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00300-hard-string-to-number/test-cases.ts
questions/00300-hard-string-to-number/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<ToNumber<'0'>, 0>>, Expect<Equal<ToNumber<'5'>, 5>>, Expect<Equal<ToNumber<'12'>, 12>>, Expect<Equal<ToNumber<'27'>, 27>>, Expect<Equal<ToNumber<'18@7_$%'>, never>>, ]
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00300-hard-string-to-number/template.ts
questions/00300-hard-string-to-number/template.ts
type ToNumber<S extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/19458-hard-snakecase/test-cases.ts
questions/19458-hard-snakecase/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<SnakeCase<'hello'>, 'hello'>>, Expect<Equal<SnakeCase<'userName'>, 'user_name'>>, Expect<Equal<SnakeCase<'getElementById'>, 'get_element_by_id'>>, Expect<Equal<SnakeCase<'getElementById' | 'getElementByClassNames'>, 'get_el...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/19458-hard-snakecase/template.ts
questions/19458-hard-snakecase/template.ts
type SnakeCase<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02757-medium-partialbykeys/test-cases.ts
questions/02757-medium-partialbykeys/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' interface User { name: string age: number address: string } interface UserPartialName { name?: string age: number address: string } interface UserPartialNameAndAge { name?: string age?: number address: string } type cases = [ Expect<Equ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02757-medium-partialbykeys/template.ts
questions/02757-medium-partialbykeys/template.ts
type PartialByKeys<T, K> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00017-hard-currying-1/test-cases.ts
questions/00017-hard-currying-1/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' const curried1 = Currying((a: string, b: number, c: boolean) => true) const curried2 = Currying((a: string, b: number, c: boolean, d: boolean, e: boolean, f: string, g: boolean) => true) const curried3 = Currying(() => true) type cases = [ Expect<Equal< ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00017-hard-currying-1/template.ts
questions/00017-hard-currying-1/template.ts
declare function Currying(fn: any): any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00147-hard-c-printf-parser/test-cases.ts
questions/00147-hard-c-printf-parser/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<ParsePrintFormat<''>, []>>, Expect<Equal<ParsePrintFormat<'Any string.'>, []>>, Expect<Equal<ParsePrintFormat<'The result is %d.'>, ['dec']>>, Expect<Equal<ParsePrintFormat<'The result is %%d.'>, []>>, Expect<Equal<ParseP...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00147-hard-c-printf-parser/template.ts
questions/00147-hard-c-printf-parser/template.ts
type ControlsMap = { c: 'char' s: 'string' d: 'dec' o: 'oct' h: 'hex' f: 'float' p: 'pointer' } type ParsePrintFormat = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/31824-hard-length-of-string-3/test-cases.ts
questions/31824-hard-length-of-string-3/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type Deced = [10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] type Signum = Deced[number] type Reped< S extends string, C extends Signum, R extends string = '', > = (C extends 0 ? R : Reped<S, Deced[C], `${R}${S}`> ) type t0 = 'k' type t1 = Reped<t0, 10> ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/31824-hard-length-of-string-3/template.ts
questions/31824-hard-length-of-string-3/template.ts
type LengthOfString<S extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09896-medium-get-middle-element/test-cases.ts
questions/09896-medium-get-middle-element/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<GetMiddleElement<[]>, []>>, Expect<Equal<GetMiddleElement<[1, 2, 3, 4, 5]>, [3]>>, Expect<Equal<GetMiddleElement<[1, 2, 3, 4, 5, 6]>, [3, 4]>>, Expect<Equal<GetMiddleElement<[() => string]>, [() => string]>>, Expect<Equal...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/09896-medium-get-middle-element/template.ts
questions/09896-medium-get-middle-element/template.ts
type GetMiddleElement<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02828-hard-classpublickeys/test-cases.ts
questions/02828-hard-classpublickeys/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' class A { public str: string protected num: number private bool: boolean constructor() { this.str = 'naive' this.num = 19260917 this.bool = true } getNum() { return Math.random() } } type cases = [ Expect<Equal<ClassPublicKey...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/02828-hard-classpublickeys/template.ts
questions/02828-hard-classpublickeys/template.ts
type ClassPublicKeys = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03192-medium-reverse/test-cases.ts
questions/03192-medium-reverse/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Reverse<[]>, []>>, Expect<Equal<Reverse<['a', 'b']>, ['b', 'a']>>, Expect<Equal<Reverse<['a', 'b', 'c']>, ['c', 'b', 'a']>>, ] type errors = [ // @ts-expect-error Reverse<'string'>, // @ts-expect-error Reverse<{ key:...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/03192-medium-reverse/template.ts
questions/03192-medium-reverse/template.ts
type Reverse<T> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/04260-medium-nomiwase/test-cases.ts
questions/04260-medium-nomiwase/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<AllCombinations<''>, ''>>, Expect<Equal<AllCombinations<'A'>, '' | 'A'>>, Expect<Equal<AllCombinations<'AB'>, '' | 'A' | 'B' | 'AB' | 'BA'>>, Expect<Equal<AllCombinations<'ABC'>, '' | 'A' | 'B' | 'C' | 'AB' | 'AC' | 'BA' | ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/04260-medium-nomiwase/template.ts
questions/04260-medium-nomiwase/template.ts
type AllCombinations<S> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00119-medium-replaceall/test-cases.ts
questions/00119-medium-replaceall/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<ReplaceAll<'foobar', 'bar', 'foo'>, 'foofoo'>>, Expect<Equal<ReplaceAll<'foobar', 'bag', 'foo'>, 'foobar'>>, Expect<Equal<ReplaceAll<'foobarbar', 'bar', 'foo'>, 'foofoofoo'>>, Expect<Equal<ReplaceAll<'t y p e s', ' ', ''>, ...
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00119-medium-replaceall/template.ts
questions/00119-medium-replaceall/template.ts
type ReplaceAll<S extends string, From extends string, To extends string> = any
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false
type-challenges/type-challenges
https://github.com/type-challenges/type-challenges/blob/00122042c4c58f12227e97c68235dfde1fd2129d/questions/00268-easy-if/test-cases.ts
questions/00268-easy-if/test-cases.ts
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<If<true, 'a', 'b'>, 'a'>>, Expect<Equal<If<false, 'a', 2>, 2>>, Expect<Equal<If<boolean, 'a', 2>, 'a' | 2>>, ] // @ts-expect-error type error = If<null, 'a', 'b'>
typescript
MIT
00122042c4c58f12227e97c68235dfde1fd2129d
2026-01-04T15:39:52.431107Z
false