v2.0.0
range
, toRange
Fix
- Throw an error when passed unexpected arguments to avoid an infinite loop.
Breaking
- Throw an error when passed 0 to
step
arugument, because the previous result is not intuitive, and there is rare case to explicitly setstep
to 0.
// before v2.0.0
range(0, 5, 0) // returns [0, 0, 0, 0], to match lodash's `range`
toRange(0, 5, 0) // returns [0, 0, 0, 0, 0]
// after
range(0, 5, 0) // throws an error
toRange(0, 5, 0) // throws an error