NaturalNumbersLessThanOrEqualTo
Type Aliases
NaturalNumbersLessThanOrEqualTo
Ƭ NaturalNumbersLessThanOrEqualTo<N
, Acc
>: Acc
extends [unknown
, ...(infer Tail)] ? Tail
["length"
] extends N
? Acc
[number
] : NaturalNumbersLessThanOrEqualTo
<N
, [...Acc, Acc
["length"
]]> : NaturalNumbersLessThanOrEqualTo
<N
, [...Acc, Acc
["length"
]]>
Helper type to get a range of integers between 0 and N.
From: https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range
Type parameters
Name | Type |
---|---|
N | extends number |
Acc | extends number [] = [] |
Defined in
packages/isaacscript-common/src/types/NaturalNumbersLessThanOrEqualTo.ts:7