Skip to content

Releases: smikitky/node-multi-integer-range

v6.1.0

Choose a tag to compare

@smikitky smikitky released this 04 Jul 22:14
  • Widened the TypeScript signature of normalize. The runtime behavior is unchanged. Now normalize officially supports new Set([2, 1, 3]), etc., as an argument.
    • Before: normalize(data?: (number | Range)[] | number): MultiIntegerRange
    • After: normalize(data?: Iterable<number | Range> | number): MultiIntegerRange
  • Set up tests for Node 26.

v6.0.0

Choose a tag to compare

@smikitky smikitky released this 02 Nov 09:17

❗️ 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

Choose a tag to compare

@smikitky smikitky released this 09 Mar 14:06
5.2.0

v5.1.0

Choose a tag to compare

@smikitky smikitky released this 08 Mar 11:47
5.1.0

v5.0.0

Choose a tag to compare

@smikitky smikitky released this 26 Apr 09:43
5.0.0

v4.0.4

Choose a tag to compare

@smikitky smikitky released this 13 Feb 05:55
  • Only cosmetic changes and doc updates.

v4.0.3

Choose a tag to compare

@smikitky smikitky released this 20 Sep 06:03
  • Fixed a bug where the copy constructor did not correctly copy the source's parse options (#9)

v4.0.2

Choose a tag to compare

@smikitky smikitky released this 15 Jul 09:38
  • Fixed broken Runkit (tonic) example

v4.0.1

Choose a tag to compare

@smikitky smikitky released this 15 Jul 07:57
  • Remove package-lock.json from the release package

v4.0.0

Choose a tag to compare

@smikitky smikitky released this 15 Jul 05:50

❗️ 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.