Skip to content

Releases: smikitky/node-multi-integer-range

v5.2.0

09 Mar 14:06
Compare
Choose a tag to compare

v5.1.0

08 Mar 11:47
Compare
Choose a tag to compare
5.1.0

v5.0.0

26 Apr 09:43
Compare
Choose a tag to compare
5.0.0

v4.0.4

13 Feb 05:55
Compare
Choose a tag to compare
  • Only cosmetic changes and doc updates.

v4.0.3

20 Sep 06:03
Compare
Choose a tag to compare
  • Fixed a bug where the copy constructor did not correctly copy the source's parse options (#9)

v4.0.2

15 Jul 09:38
Compare
Choose a tag to compare
  • Fixed broken Runkit (tonic) example

v4.0.1

15 Jul 07:57
Compare
Choose a tag to compare
  • Remove package-lock.json from the release package

v4.0.0

15 Jul 05:50
Compare
Choose a tag to compare

❗️ 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 options parameter, with which you can modify the parsing strategy. See above.
  • MultiRange is now exported also as the default export of the module. You can use import MR from 'multi-integer-range' instead of import { MultiRange as MR } from 'multi-integer-range'.
  • Iterator shimming: The type of Symbol.iterator is no longer strictly checked using typeof. This means polyfilled symbols (using core-js or such) will enable MultiRange.prototype[Symbol.iterator], and for ... of loops will correctly transpile to ES5 using Babel or TypeScript (>=2.3 with --downlevelIteration).
  • Used ES2015 in the documentation.

v3.0.0

06 Oct 16:33
Compare
Choose a tag to compare

Breaking Changes

  • Removed the following methods which had been deprecated since v2.0.0.
    • isContinuous() (Gone for good. Use segmentLength() === 1 instead)
    • 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.ts file 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 --strictNullChecks flag. See this issue for details.)

New

  • Added four convenient methods: min(), max(), shift(), and pop()

v2.1.0

06 Sep 10:35
Compare
Choose a tag to compare
  • Added support for unbounded (i.e., infinite) ranges.
  • Added support for ranges containing zero and negative integers.
  • Added isUnbounded() method.

Background Compatibility: Most existing code should work just fine, but strings which used to be errors are now considered valid. For example, new MultiRange('2-') and new MultiRange('(-10)') raised a SyntaxError until v2.0.0, but now these are valid ways to denote unbound and negative ranges, respectively. Those who passes arbitrary user input to the string parser may have to perform additional error checking. Use #isUnbounded() to check if an instance is unbounded (infinite). Or limiting the range using #intersection() should be enough for most cases.