type-fest
type-fest copied to clipboard
IntRange Inclusive
The IntRange
type was added in this PR. As mentioned in the documentation The numbers are created from the given
Start(inclusive) parameter to the given
End (exclusive) parameter.
.
Could an option be added to this type that would allow the end parameter to be inclusive? For example,
IntRangeInclusive<0, 3> = 0 | 1 | 2 | 3
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- The funding will be given to active contributors.
- Thank you in advance for helping prioritize & fund our backlog.
Yeah, we should add a inclusive range method too.
Alternative name: IntClosedRange
Yes please, would be easy to define it
type IntClosedRange<Start extends number, End extends number> = IntRange<Start, End> | End
Yes please, would be easy to define it
type IntClosedRange<Start extends number, End extends number> = IntRange<Start, End> | End
I think it should be
type IntClosedRange<Start extends number, End extends number, Skip extends number> = IntRange<Start, Add<End, 1>, Skip>