Skip to content

feat(tuples): Tuples.Repeat#126

Open
airismadeupofair wants to merge 3 commits intogvergnaud:mainfrom
airismadeupofair:feat/tuples-repeat
Open

feat(tuples): Tuples.Repeat#126
airismadeupofair wants to merge 3 commits intogvergnaud:mainfrom
airismadeupofair:feat/tuples-repeat

Conversation

@airismadeupofair
Copy link

Hello,

This is my first commit to this repo, so please feel free to tell me what is wrong, with the guidelines or with the Repeat

basically it works like this.

type Test0 = Call<Repeat<never>,10> // [never, never, never, never, never, never, never, never, never, never]

also can support past 1000 elements,

also works in pipe

type res2 = Pipe<[1,2],
    //    ^?
    [Tuples.Repeat<_, 20>]
> // [[1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2]]

adds a Repeat utility in the Tuples namespace

uses low recursion steps and can supports repetition past 1000 elements
added a `Tuples.Repeat`

can create above 1000 elements

very efficient, can create tuple in 1-4 recursion steps
to pass `tsup` and avoid typescript errors
@airismadeupofair airismadeupofair marked this pull request as ready for review March 2, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant