Skip to content

v2.0.0

Compare
Choose a tag to compare
@KoichiKiyokawa KoichiKiyokawa released this 21 Feb 02:09
· 97 commits to main since this release

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 set step 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