We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enumerate
IntRange
Useful for when we are working with restrict numeric values
definition:
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]> type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>> | T
So it can be used:
type ValidAmount = Enumerate<4> // 0 | 1 | 2 | 3 type WeekDay = IntRange<1, 7> // 1 | 2 | 3 | 4 | 5 | 6 | 7
The text was updated successfully, but these errors were encountered:
Related to #123
Sorry, something went wrong.
This is accepted.
intRange
Successfully merging a pull request may close this issue.
Useful for when we are working with restrict numeric values
definition:
So it can be used:
The text was updated successfully, but these errors were encountered: