Releases: smikitky/node-multi-integer-range
Releases · smikitky/node-multi-integer-range
v6.0.0
❗️ Breaking Changes
- Dropped support for CJS modules. This package is now ESM-only.
- Changed the internal directory structure under
lib. If you are importing from a specific file, you need to change the path.
Other Changes
- Migrated the test framework from Jest to Node's Test Runner.
- Set the tests to run only on Node 20, 22, and 24. However, this package is expected to function in any JS environment as long as ESM is supported; if it does not, please file an issue.
v5.2.0
v5.1.0
v5.0.0
v4.0.4
v4.0.3
v4.0.2
v4.0.1
v4.0.0
❗️ Breaking Changes
-
The string parser no longer accepts unbounded and negative ranges by default. To parse strings possibly containing unbound/negative ranges (eg
10-,(-5)-0), you need to manually pass an option to enable them.const userInput = '-5, 10-15, 30, 45-'; const pagesInMyDoc = [[1, 100]]; const mr = new MultiRange(userInput, { parseUnbounded: true }).intersect(pagesInMyDoc);
Note that this affects only the string parser. Array/number initializers always accept unbounded/negative ranges, just as before.
const mr = new MultiRange([[-5, 3], [10, Inifinity]]); // This is always valid
New
- The constructor now takes an optional
optionsparameter, with which you can modify the parsing strategy. See above. MultiRangeis now exported also as the default export of the module. You can useimport MR from 'multi-integer-range'instead ofimport { MultiRange as MR } from 'multi-integer-range'.- Iterator shimming: The type of
Symbol.iteratoris no longer strictly checked usingtypeof. This means polyfilled symbols (using core-js or such) will enableMultiRange.prototype[Symbol.iterator], andfor ... ofloops will correctly transpile to ES5 using Babel or TypeScript (>=2.3 with--downlevelIteration). - Used ES2015 in the documentation.
v3.0.0
Breaking Changes
- Removed the following methods which had been deprecated since v2.0.0.
isContinuous()(Gone for good. UsesegmentLength() === 1instead)hasRange()*appendRange()*subtractRnage()*
It's still possible to access some methods (marked with *) unless you are using TypeScript (these methods were only turned to private methods). They will be there for the time being, although undocumented.
- (TypeScript)
*.d.tsfile included in the package is now ready for--strictNullChecks. This means TypeScript users need to update their compiler to v2.0 or later to use the definition file. (You do not necessarily have to enable--strictNullChecksflag. See this issue for details.)
New
- Added four convenient methods:
min(),max(),shift(), andpop()