|
1 | | -import type {BuildTuple} from './internal/index.d.ts'; |
| 1 | +import type {TupleOf} from './tuple-of.d.ts'; |
2 | 2 | import type {Subtract} from './subtract.d.ts'; |
3 | 3 |
|
4 | 4 | /** |
@@ -44,16 +44,16 @@ type PrivateIntRange< |
44 | 44 | // The gap between each number, gap = step - 1 |
45 | 45 | Gap extends number = Subtract<Step, 1>, |
46 | 46 | // The final `List` is `[...StartLengthTuple, ...[number, ...GapLengthTuple], ...[number, ...GapLengthTuple], ... ...]`, so can initialize the `List` with `[...StartLengthTuple]` |
47 | | - List extends unknown[] = BuildTuple<Start, never>, |
48 | | - EndLengthTuple extends unknown[] = BuildTuple<End>, |
| 47 | + List extends unknown[] = TupleOf<Start, never>, |
| 48 | + EndLengthTuple extends unknown[] = TupleOf<End>, |
49 | 49 | > = Gap extends 0 ? |
50 | 50 | // Handle the case that without `Step` |
51 | 51 | List['length'] extends End // The result of "List[length] === End" |
52 | 52 | ? Exclude<List[number], never> // All unused elements are `never`, so exclude them |
53 | 53 | : PrivateIntRange<Start, End, Step, Gap, [...List, List['length'] ]> |
54 | 54 | // Handle the case that with `Step` |
55 | | - : List extends [...(infer U), ...EndLengthTuple] // The result of "List[length] >= End", because the `...BuildTuple<Gap, never>` maybe make `List` too long. |
| 55 | + : List extends [...(infer U), ...EndLengthTuple] // The result of "List[length] >= End", because the `...TupleOf<Gap, never>` maybe make `List` too long. |
56 | 56 | ? Exclude<List[number], never> |
57 | | - : PrivateIntRange<Start, End, Step, Gap, [...List, List['length'], ...BuildTuple<Gap, never>]>; |
| 57 | + : PrivateIntRange<Start, End, Step, Gap, [...List, List['length'], ...TupleOf<Gap, never>]>; |
58 | 58 |
|
59 | 59 | export {}; |
0 commit comments