#Union of numbers between range
6 messages · Page 1 of 1 (latest)
type UpTo<N extends number, A extends number[] = []> =
A['length'] extends N ? A[number] : UpTo<N, [...A, A['length']]>
@runic fiber Might be possible to modify this to go from a different number than 0.
Honestly this is just a snippet that floats around this server, might be able to find a more advanced version if you search around.