diff --git a/README.md b/README.md index 8223d0f..69d609b 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,6 @@ type Baz = IsFinite<[0, 1, 2], 'finite', 'infinite'> // Expect: 'finite' const baz: Baz = 'finite' ``` -### `SplitInfiniteTuple` - -```typescript -import { SplitInfiniteTuple } from 'typescript-tuple' -type Foo = SplitInfiniteTuple<[0, 1, 2, ...number[]]> // Expect: [[0, 1, 2], number[]] -type FinitePart = Foo[0] // Expect: [0, 1, 2] -type InfinitePart = Foo[1] // Expect: number[] -const foo: Foo = [[0, 1, 2], Array()] -const finitePart: FinitePart = [0, 1, 2] -const infinitePart: InfinitePart = Array() -``` - ### `First` ```typescript @@ -59,126 +47,6 @@ type Foo = Tail<['a', 'b', 'c']> // Expect: ['b', 'c'] const foo: Foo = ['b', 'c'] ``` -### `FirstIndexEqual` - -```typescript -import { FirstIndexEqual } from 'typescript-tuple' - -type Foo = FirstIndexEqual<'x', ['a', 'x', 'b', 'x']> // Expect: 1 -const foo: Foo = 1 - -type Bar = FirstIndexEqual<'x', ['a', 'b']> // Expect: never - -type Baz = FirstIndexEqual<'x', ['a', 'b'], 'not found'> // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `FirstIndexSubset` - -```typescript -import { FirstIndexSubset } from 'typescript-tuple' - -type Foo = FirstIndexSubset // Expect: 1 -const foo: Foo = 1 - -type Bar = FirstIndexSubset // Expect: never - -type Baz = FirstIndexSubset // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `FirstIndexSuperset` - -```typescript -import { FirstIndexSuperset } from 'typescript-tuple' - -type Foo = FirstIndexSuperset<'x', [number, string, 0 | 1, 'x' | 'y']> // Expect: 1 -const foo: Foo = 1 - -type Bar = FirstIndexSuperset<'x', [number, 0 | 1]> // Expect: never - -type Baz = FirstIndexSuperset<'x', [number, 0 | 1], 'not found'> // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `LastIndexEqual` - -```typescript -import { LastIndexEqual } from 'typescript-tuple' - -type Foo = LastIndexEqual<'x', ['a', 'x', 'b', 'x']> // Expect: 3 -const foo: Foo = 3 - -type Bar = LastIndexEqual<'x', ['a', 'b']> // Expect: never - -type Baz = LastIndexEqual<'x', ['a', 'b'], 'not found'> // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `LastIndexSubset` - -```typescript -import { LastIndexSubset } from 'typescript-tuple' - -type Foo = LastIndexSubset // Expect: 3 -const foo: Foo = 3 - -type Bar = LastIndexSubset // Expect: never - -type Baz = LastIndexSubset // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `LastIndexSuperset` - -```typescript -import { LastIndexSuperset } from 'typescript-tuple' - -type Foo = LastIndexSuperset<'x', [number, string, 0 | 1, 'x' | 'y']> // Expect: 3 -const foo: Foo = 3 - -type Bar = LastIndexSuperset<'x', [number, 0 | 1]> // Expect: never - -type Baz = LastIndexSuperset<'x', [number, 0 | 1], 'not found'> // Expect: 'not found' -const baz: Baz = 'not found' -``` - -### `AllIndexesEqual` - -```typescript -import { AllIndexesEqual } from 'typescript-tuple' - -type Foo = AllIndexesEqual<'x', ['a', 'x', 'b', 'x']> // Expect: [1, 3] -const foo: Foo = [1, 3] - -type Bar = AllIndexesEqual<'x', ['a', 'x', 'b', ...'x'[]]> // Expect: [1, ...3[]] -const bar: Bar = [1, 3, 3, 3, 3] -``` - -### `AllIndexesSubset` - -```typescript -import { AllIndexesSubset } from 'typescript-tuple' - -type Foo = AllIndexesSubset // Expect: [1, 3] -const foo: Foo = [1, 3] - -type Bar = AllIndexesSubset // Expect: [1, ...3[]] -const bar: Bar = [1, 3, 3, 3, 3] -``` - -### `AllIndexesSuper` - -```typescript -import { AllIndexesSuper } from 'typescript-tuple' - -type Foo = AllIndexesSuper<'x', [number, string, 0 | 1, 'x' | 'y']> // Expect: [1, 3] -const foo: Foo = [1, 3] - -type Bar = AllIndexesSuper<'x', [number, string, 0 | 1, ...'x'[]]> // Expect: [1, ...3[]] -const bar: Bar = [1, 3, 3, 3, 3] -``` - ### `Append` ```typescript @@ -269,18 +137,6 @@ type Foo = SliceStartQuantity<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 2, 4> // Expect [2 const foo: Foo = [2, 3, 4, 5] ``` -### `SingleTupleSet` - -```typescript -import { SingleTupleSet } from 'typescript-tuple' - -type Foo = SingleTupleSet<[0, 1, 2]> // Expect [[0], [1], [2]] -const foo: Foo = [[0], [1], [2]] - -type Bar = SingleTupleSet<'x'[]> // Expect ['x'][] -const bar: Bar = Array<['x']>() -``` - ### `FillTuple` ```typescript diff --git a/lib/index.ts b/lib/index.ts index 5326d37..1a4ec69 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -10,12 +10,6 @@ import * as utils from './utils' export type IsFinite = utils.IsFinite -/** - * Split an infinite tuple into a finite tuple and an array - * @example SplitInfiniteTuple<[0, 1, 2, ...number[]]> → [[0, 1, 2], number[]] - */ -export type SplitInfiniteTuple = utils.SplitInfiniteTuple - /** * Get type of first element * @example First<[0, 1, 2]> → 0 @@ -34,81 +28,6 @@ export type Last = utils.Last */ export type Tail = utils.Tail -/** - * Find index of a type in tuple - * @example FirstIndexEqual<'x', ['a', 'b', 'c', 'x', 'd']> → 3 - * @example FirstIndexEqual<'x', ['a', 'b', 'c']> → never - * @example FirstIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'> → 'NotFound' - */ -export type FirstIndexEqual = - utils.FirstIndexEqual - -/** - * Find index of the first element in tuple that satifies a type - * @example FirstIndexSubset → 2 - * @example FirstIndexSubset → never - * @example FirstIndexSubset → 'NotFound' - */ -export type FirstIndexSubset = - utils.FirstIndexSubset - -/** - * Find index of the first element in tuple that satifies a type - * @example FirstIndexSuperset<5, [boolean, string, number, object]> → 2 - * @example FirstIndexSuperset<5, [boolean, string, object]> → never - * @example FirstIndexSuperset<5, [boolean, string, object], 'NotFound'> → 'NotFound' - */ -export type FirstIndexSuperset = - utils.FirstIndexSuperset - -/** - * Find index of a type in tuple - * @example LastIndexEqual<'x', ['a', 'b', 'c', 'x', 'd']> → 3 - * @example LastIndexEqual<'x', ['a', 'b', 'c']> → never - * @example LastIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'> → 'NotFound' - */ -export type LastIndexEqual = - utils.LastIndexEqual - -/** - * Find index of the first element in tuple that satifies a type - * @example LastIndexSubset → 2 - * @example LastIndexSubset → never - * @example LastIndexSubset → 'NotFound' - */ -export type LastIndexSubset = - utils.LastIndexSubset - -/** - * Find index of the first element in tuple that satifies a type - * @example LastIndexSuperset<5, [boolean, string, number, object]> → 2 - * @example LastIndexSuperset<5, [boolean, string, object]> → never - * @example LastIndexSuperset<5, [boolean, string, object], 'NotFound'> → 'NotFound' - */ -export type LastIndexSuperset = - utils.LastIndexSuperset - -/** - * Find all indexes of a type in tuple - * @example AllIndexesEqual<'x', ['a', 'b', 'x', 'c', 'x', 'x']> → [2, 4, 5] - */ -export type AllIndexesEqual = - utils._IndexesNormalize> - -/** - * Find all indexes of a type in tuple - * @example AllIndexesSubset → [2, 4, 5] - */ -export type AllIndexesSubset = - utils._IndexesNormalize> - -/** - * Find all indexes of a type in tuple - * @example AllIndexesSuperset<'x', [number, boolean, string, 0, 'x', 'a' | 'b']> → [2, 4, 5] - */ -export type AllIndexesSuperset = - utils._IndexesNormalize> - /** * Add an element to the end of a tuple * @example Append<[0, 1, 2], 'new'> → [0, 1, 2, 'new'] @@ -165,13 +84,6 @@ export type SliceStartQuantity< Quantity extends number > = utils.SliceStartQuantity -/** - * Create a set of tuple of single element - * @example SingleTupleSet<[0, 1, 2]> → [[0], [1], [2]] - * @example SingleTupleSet<[0, 1, 2, ...number[]]> → [[0], [1], [2], ...[number][]] - */ -export type SingleTupleSet = utils.SingleTupleSet - /** * Fill a tuple of types * @example FillTuple<[0, 1, 2], 'x'> → ['x', 'x', 'x'] diff --git a/lib/utils.ts b/lib/utils.ts index 0b8af26..affeaf0 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,5 +1,3 @@ -import { Extends, Equal } from 'typescript-compare' - export type IsFinite = { empty: Finite nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) @@ -15,13 +13,6 @@ export type IsFinite = { : never ] -export type SplitInfiniteTuple = - _SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - [Reverse, Infinite] - : never - : never - export type _SplitInfiniteTuple = { matched: [Holder, Tuple] unmatched: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) @@ -56,216 +47,6 @@ export type Tail = ? Rest : never -export type FirstIndexEqual< - Type, - Tuple extends any[], - NotFound = never, - Count extends any[] = [] -> = { - empty: NotFound - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Equal extends true ? - Count['length'] - : FirstIndexEqual> - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - FirstIndexEqual< - Type, - Finite, - Infinite extends Type[] ? Type[] extends Infinite ? - Finite['length'] - : NotFound : NotFound - > - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - -export type FirstIndexSubset< - Type, - Tuple extends any[], - NotFound = never, - Count extends any[] = [] -> = { - empty: NotFound - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Extends extends true ? - Count['length'] - : FirstIndexSubset> - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - FirstIndexSubset< - Type, - Finite, - Infinite extends Type[] ? Finite['length'] : NotFound - > - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - -export type FirstIndexSuperset< - Type, - Tuple extends any[], - NotFound = never, - Count extends any[] = [] -> = { - empty: NotFound - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Extends extends true ? - Count['length'] - : FirstIndexSuperset> - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - FirstIndexSuperset< - Type, - Finite, - Extends extends true ? Finite['length'] : NotFound - > - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - -export type LastIndexEqual = - _LastIndexFirst<_AllIndexesEqual, NotFound> - -export type LastIndexSubset = - _LastIndexFirst<_AllIndexesSubset, NotFound> - -export type LastIndexSuperset = - _LastIndexFirst<_AllIndexesSuperset, NotFound> - -export type _LastIndexFirst = IsFinite< - Tuple, - First, - SplitInfiniteTuple extends [any, infer Infinite] ? - Infinite extends (infer X) ? - X - : never - : never -> - -export type _IndexesNormalize = IsFinite< - Indexes, - - Indexes extends any[] - ? Reverse - : never, - - SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - ((..._: Finite) => any) extends ((..._: infer Alt) => any) ? - Infinite extends any[] ? - Concat, Infinite> - : never - : never - : never - : never -> - -export type _AllIndexesEqual< - Type, - Tuple extends any[], - Holder extends any[] = [], - Count extends any[] = [] -> = { - empty: Holder - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Rest extends any[] ? - _AllIndexesEqual< - Type, - Rest, - Equal extends true ? Prepend : Holder, - Prepend - > - : never - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - Infinite extends (infer Last)[] ? - _AllIndexesEqual< - Type, - Finite, - Equal extends true ? Finite['length'][] : [] - > - : never - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - -export type _AllIndexesSubset< - Type, - Tuple extends any[], - Holder extends any[] = [], - Count extends any[] = [] -> = { - empty: Holder - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Rest extends any[] ? - _AllIndexesSubset< - Type, - Rest, - Extends extends true ? Prepend : Holder, - Prepend - > - : never - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - Infinite extends (infer Last)[] ? - _AllIndexesSubset< - Type, - Finite, - Extends extends true ? Finite['length'][] : [] - > - : never - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - -export type _AllIndexesSuperset< - Type, - Tuple extends any[], - Holder extends any[] = [], - Count extends any[] = [] -> = { - empty: Holder - nonEmpty: ((..._: Tuple) => any) extends ((_: infer First, ..._1: infer Rest) => any) ? - Rest extends any[] ? - _AllIndexesSuperset< - Type, - Rest, - Type extends First ? Prepend : Holder, - Prepend - > - : never - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - Infinite extends (infer Last)[] ? - _AllIndexesSuperset< - Type, - Finite, - Type extends Last ? Finite['length'][] : [] - > - : never - : never - : never -}[ - Tuple extends [] ? 'empty' : IsFinite -] - export type Prepend = [Addend, ...Tuple] export type Reverse = { @@ -368,22 +149,6 @@ export type SliceStartQuantity< 'before' ] -export type SingleTupleSet = { - empty: Holder - nonEmpty: ((..._: Reverse) => any) extends ((_: infer Last, ..._1: infer ReversedRest) => any) - ? SingleTupleSet, Prepend> - : never - infinite: SplitInfiniteTuple extends [infer Finite, infer Infinite] ? - Finite extends any[] ? - Infinite extends Array ? - SingleTupleSet - : never - : never - : never -}[ - Types extends [] ? 'empty' : IsFinite -] - export type FillTuple = { empty: Holder nonEmpty: ((...a: Tuple) => any) extends ((a: infer First, ...b: infer Rest) => any) diff --git a/package.json b/package.json index a89adb0..ebddc79 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "typescript-compare": "^0.0.2" }, "devDependencies": { - "typescript": "^4.0.2", + "typescript": "~4.0.2", "tslint": "^6.1.3", "tslint-config-standard": "^9.0.0", "static-type-assert": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80ffd6e..020ecd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -738,5 +738,5 @@ specifiers: toolcheck: ^0.1.4 tslint: ^6.1.3 tslint-config-standard: ^9.0.0 - typescript: ^4.0.2 + typescript: ~4.0.2 typescript-compare: ^0.0.2 diff --git a/spec/all-indexes-equal.ts b/spec/all-indexes-equal.ts deleted file mode 100644 index 25ad402..0000000 --- a/spec/all-indexes-equal.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { compare } from 'static-type-assert' -import { AllIndexesEqual } from '..' - -compare< - AllIndexesEqual<'x', ['a', 'b', 'x', 'c', 'x', 'x']>, - [2, 4, 5] ->('equal') - -compare< - AllIndexesEqual<'x', ['a', 'b', 'x', 'd', ...'x'[]]>, - [2, ...4[]] ->('equal') - -compare< - AllIndexesEqual<'x', 'x'[]>, - 0[] ->('equal') - -compare< - AllIndexesEqual<'x', []>, - [] ->('equal') - -compare< - AllIndexesEqual<'x', [0, 1, 2, 3]>, - [] ->('equal') - -compare< - AllIndexesEqual<'x', 'y'[]>, - [] ->('equal') - -compare< - AllIndexesEqual<'x', [0, 1, 2, 3, ...number[]]>, - [] ->('equal') diff --git a/spec/all-indexes-subset.ts b/spec/all-indexes-subset.ts deleted file mode 100644 index 8bab758..0000000 --- a/spec/all-indexes-subset.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { compare } from 'static-type-assert' -import { AllIndexesSubset } from '..' - -compare< - AllIndexesSubset, - [2, 4, 5] ->('equal') - -compare< - AllIndexesSubset, - [2, ...4[]] ->('equal') - -compare< - AllIndexesSubset, - 0[] ->('equal') - -compare< - AllIndexesSubset, - [] ->('equal') - -compare< - AllIndexesSubset, - [] ->('equal') - -compare< - AllIndexesSubset, - [] ->('equal') - -compare< - AllIndexesSubset, - [] ->('equal') diff --git a/spec/all-indexes-superset.ts b/spec/all-indexes-superset.ts deleted file mode 100644 index a14c026..0000000 --- a/spec/all-indexes-superset.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { compare } from 'static-type-assert' -import { AllIndexesSuperset } from '..' - -compare< - AllIndexesSuperset<'x', [number, boolean, string, null, 'x', 'x' | 'y']>, - [2, 4, 5] ->('equal') - -compare< - AllIndexesSuperset<'x', [number, boolean, string, null, ...'x'[]]>, - [2, ...4[]] ->('equal') - -compare< - AllIndexesSuperset<'x', string[]>, - 0[] ->('equal') - -compare< - AllIndexesSuperset<'x', []>, - [] ->('equal') - -compare< - AllIndexesSuperset<'x', [number, boolean, null]>, - [] ->('equal') - -compare< - AllIndexesSuperset<'x', number[]>, - [] ->('equal') - -compare< - AllIndexesSuperset<'x', [number, boolean, null, ...number[]]>, - [] ->('equal') diff --git a/spec/first-index-equal.ts b/spec/first-index-equal.ts deleted file mode 100644 index d72a4c0..0000000 --- a/spec/first-index-equal.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { FirstIndexEqual } from '..' - -compare< - FirstIndexEqual<'x', ['a', 'b', 'x', 'c', 'x']>, - 2 ->('equal') - -compare< - FirstIndexEqual<'x', ['a', 'b', 'c', ...'x'[]]>, - 3 ->('equal') - -compare< - FirstIndexEqual<'x', 'x'[]>, - 0 ->('equal') - -compare< - FirstIndexEqual<'x', []>, - never ->('equal') - -compare< - FirstIndexEqual<'x', ['a', 'b', 'c']>, - never ->('equal') - -compare< - FirstIndexEqual<'x', string[]>, - never ->('equal') - -compare< - FirstIndexEqual<'x', ['a', 'b', 'c', ...string[]]>, - never ->('equal') - -compare< - FirstIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'>, - 'NotFound' ->('equal') diff --git a/spec/first-index-subset.ts b/spec/first-index-subset.ts deleted file mode 100644 index 2d8d33e..0000000 --- a/spec/first-index-subset.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { FirstIndexSubset } from '..' - -compare< - FirstIndexSubset, - 2 ->('equal') - -compare< - FirstIndexSubset, - 3 ->('equal') - -compare< - FirstIndexSubset, - 0 ->('equal') - -compare< - FirstIndexSubset, - never ->('equal') - -compare< - FirstIndexSubset, - never ->('equal') - -compare< - FirstIndexSubset, - never ->('equal') - -compare< - FirstIndexSubset, - never ->('equal') - -compare< - FirstIndexSubset, - 'NotFound' ->('equal') diff --git a/spec/first-index-superset.ts b/spec/first-index-superset.ts deleted file mode 100644 index f2acafb..0000000 --- a/spec/first-index-superset.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { FirstIndexSuperset } from '..' - -compare< - FirstIndexSuperset<'x', [number, symbol, string, boolean, 'x']>, - 2 ->('equal') - -compare< - FirstIndexSuperset<'x', [number, symbol, boolean, ...string[]]>, - 3 ->('equal') - -compare< - FirstIndexSuperset<'x', string[]>, - 0 ->('equal') - -compare< - FirstIndexSuperset<'x', []>, - never ->('equal') - -compare< - FirstIndexSuperset<'x', [number, symbol, boolean]>, - never ->('equal') - -compare< - FirstIndexSuperset<'x', number[]>, - never ->('equal') - -compare< - FirstIndexSuperset<'x', [number, symbol, boolean, ...object[]]>, - never ->('equal') - -compare< - FirstIndexSuperset<'x', [number, symbol, boolean], 'NotFound'>, - 'NotFound' ->('equal') diff --git a/spec/last-index-equal.ts b/spec/last-index-equal.ts deleted file mode 100644 index e66b954..0000000 --- a/spec/last-index-equal.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { LastIndexEqual } from '..' - -compare< - LastIndexEqual<'x', ['a', 'b', 'x', 'c', 'x', 'd']>, - 4 ->('equal') - -compare< - LastIndexEqual<'x', ['a', 'b', 'c', ...'x'[]]>, - 3[] ->('equal') - -compare< - LastIndexEqual<'x', 'x'[]>, - 0[] ->('equal') - -compare< - LastIndexEqual<'x', []>, - never ->('equal') - -compare< - LastIndexEqual<'x', ['a', 'b', 'c']>, - never ->('equal') - -compare< - LastIndexEqual<'x', string[]>, - never ->('equal') - -compare< - LastIndexEqual<'x', ['a', 'b', 'c', ...string[]]>, - never ->('equal') - -compare< - LastIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'>, - 'NotFound' ->('equal') diff --git a/spec/last-index-subset.ts b/spec/last-index-subset.ts deleted file mode 100644 index 03e841d..0000000 --- a/spec/last-index-subset.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { LastIndexSubset } from '..' - -compare< - LastIndexSubset, - 5 ->('equal') - -compare< - LastIndexSubset, - 3[] ->('equal') - -compare< - LastIndexSubset, - 0[] ->('equal') - -compare< - LastIndexSubset, - never ->('equal') - -compare< - LastIndexSubset, - never ->('equal') - -compare< - LastIndexSubset, - never ->('equal') - -compare< - LastIndexSubset, - never ->('equal') - -compare< - LastIndexSubset, - 'NotFound' ->('equal') diff --git a/spec/last-index-superset.ts b/spec/last-index-superset.ts deleted file mode 100644 index af4f0d7..0000000 --- a/spec/last-index-superset.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { compare } from 'static-type-assert' -import { LastIndexSuperset } from '..' - -compare< - LastIndexSuperset<'x', [number, symbol, string, boolean, 'x' | 'y', null]>, - 4 ->('equal') - -compare< - LastIndexSuperset<'x', [number, symbol, boolean, ...string[]]>, - 3[] ->('equal') - -compare< - LastIndexSuperset<'x', string[]>, - 0[] ->('equal') - -compare< - LastIndexSuperset<'x', []>, - never ->('equal') - -compare< - LastIndexSuperset<'x', [number, symbol, boolean]>, - never ->('equal') - -compare< - LastIndexSuperset<'x', number[]>, - never ->('equal') - -compare< - LastIndexSuperset<'x', [number, symbol, boolean, ...object[]]>, - never ->('equal') - -compare< - LastIndexSuperset<'x', [number, symbol, boolean], 'NotFound'>, - 'NotFound' ->('equal') diff --git a/spec/single-tuple-set.ts b/spec/single-tuple-set.ts deleted file mode 100644 index fd7fb89..0000000 --- a/spec/single-tuple-set.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { compare } from 'static-type-assert' -import { SingleTupleSet } from '..' - -compare, []>('equal') -compare, [[0], [1], [2]]>('equal') -compare, ['x'][]>('equal') -compare, [[0], ...['x'][]]>('equal') diff --git a/spec/split-infinite-tuple.ts b/spec/split-infinite-tuple.ts deleted file mode 100644 index 98847bd..0000000 --- a/spec/split-infinite-tuple.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { compare } from 'static-type-assert' -import { SplitInfiniteTuple } from '..' - -compare, [[], 'x'[]]>('equal') -compare, [[0, 1, 2], 'x'[]]>('equal') -compare, [['x', 'x'], 'x'[]]>('equal') -compare, never>('equal') -compare, never>('equal')