range-type
v1.2.0
Published
Utils for working with numbers of specific range.
Downloads
2
Readme
range-type
This is type utils to generate type of non-negative integer number in specific range.
Utils
Range<From, To>
Returns numeric type which will contain only positive integer values from From
value to To
value exclusively.
import { Range } from 'range-type'
type D = Range<1, 10> // 1 | 2 | 3 | 4 | 5
RangeTo
Returns numeric type which will contain only positive integer values from 0
to To
value exclusively.
import { RangeTo } from 'range-type'
type C = RangeTo<3> // 0 | 1 | 2
Credits
Based on npm-typescript-package-boilerplate with a few changes.