You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,7 +256,7 @@ Click the type names for complete docs.
256
256
-[`TupleToUnion`](source/tuple-to-union.d.ts) - Convert a tuple/array into a union type of its elements.
257
257
-[`UnionToTuple`](source/union-to-tuple.d.ts) - Convert a union type into an unordered tuple type of its elements.
258
258
-[`TupleToObject`](source/tuple-to-object.d.ts) - Transforms a tuple into an object, mapping each tuple index to its corresponding type as a key-value pair.
259
-
-[`BuildTuple`](source/build-tuple.d.ts) - Creates a tuple type of the specified length with elements of the specified type.
259
+
-[`TupleOf`](source/tuple-of.d.ts) - Creates a tuple type of the specified length with elements of the specified type.
Copy file name to clipboardExpand all lines: source/int-range.d.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
importtype{BuildTuple}from'./build-tuple.d.ts';
1
+
importtype{TupleOf}from'./tuple-of.d.ts';
2
2
importtype{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
Gapextendsnumber=Subtract<Step,1>,
46
46
// The final `List` is `[...StartLengthTuple, ...[number, ...GapLengthTuple], ...[number, ...GapLengthTuple], ... ...]`, so can initialize the `List` with `[...StartLengthTuple]`
47
-
Listextendsunknown[]=BuildTuple<Start,never>,
48
-
EndLengthTupleextendsunknown[]=BuildTuple<End>,
47
+
Listextendsunknown[]=TupleOf<Start,never>,
48
+
EndLengthTupleextendsunknown[]=TupleOf<End>,
49
49
>=Gapextends0 ?
50
50
// Handle the case that without `Step`
51
51
List['length']extendsEnd// The result of "List[length] === End"
52
52
? Exclude<List[number],never>// All unused elements are `never`, so exclude them
: Listextends[...(infer U), ...EndLengthTuple]// The result of "List[length] >= End", because the `...BuildTuple<Gap, never>` maybe make `List` too long.
55
+
: Listextends[...(infer U), ...EndLengthTuple]// The result of "List[length] >= End", because the `...TupleOf<Gap, never>` maybe make `List` too long.
0 commit comments