Created
July 7, 2023 11:52
Revisions
-
ScriptRaccoon revised this gist
Jul 7, 2023 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ type Tuple<Length extends number, T, Accumulator extends T[] = []> = Accumulator["length"] extends Length ? Accumulator : Tuple<Length,T,[...Accumulator,T]>; const example: Tuple<3,string> = ["hi","mom","!"]; -
ScriptRaccoon created this gist
Jul 7, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ type Tuple<Length extends number, T, Accumulator extends T[] = []> = Accumulator["length"] extends Length ? Accumulator : Tuple<Length,T,[...Accumulator,T]>; const example: Tuple<3,string> = ["hi","mom","!"];