Changelog

All notable changes to this project will be documented in this file.
See Conventional Commits opens in a new tab for commit guidelines.

7.0.0

1 Dec 2022

💥 BREAKING CHANGES

  • Minimum supported Node version is v14.18; we’re dropping v12 support

6.2.0

12 Aug 2022

Features

6.1.2

18 Apr 2022

🔧 Fixed

6.1.0

11 Apr 2022

Features

  • export defaults and version (1107244)

6.0.0

9 Sept 2021

Features

💥 BREAKING CHANGES

  • programs now are in ES Modules and won’t work with Common JS require()

5.1.0

24 May 2021

Features

  • config file based major bump blacklisting (e15f9bb)

5.0.15

11 Apr 2021

Reverts

  • Revert “chore: setup refresh” (23cf206)

5.0.1

28 Jan 2021

🔧 Fixed

  • add testStats to npmignore (f3c84e9)

5.0.0

23 Jan 2021

Features

  • rewrite in TS, start using named exports (8e75edf)

💥 BREAKING CHANGES

  • previously you’d consume like: import Ranges from … — now import { Ranges } from …

4.0.0

28 Nov 2020

Accidental version bump during migration to SourceHut. Sorry about that.

3.7.0

1 Feb 2020

Features

  • remove couple dependencies and rebase a little bit (616b47d)

3.6.0

14 Sept 2019

Features

  • non-breaking spaces are now retained when pushing with whitespace limiter option on (2de001d)

3.5.0

11 Sept 2019

Features

  • improved whitespace insertion algorithm (b8c4463)

Reverts

  • restores back as it was before, no changes to opts.limitToBeAddedWhitespace (f0b36f3)

3.4.0

4 Sept 2019

Features

  • accept nulls among pushed values, do not throw, just do nothing (4badda3)

3.3.0

8 Aug 2019

Features

3.2.0

18 Jun 2019

Features

  • Remove check-types-mini for perf reasons and also to reduce Lerna ECYCLE warnings (50be5d8)

3.1.0

1 Jun 2019

Features

2.16.0

20 Jan 2019
  • Various documentation and setup tweaks after we migrated to monorepo
  • Setup refresh: updated dependencies and all config files using automated tools

2.13.0

26 Dec 2018
  • Harden the type checks just in case (106ae7a)
  • Implement throw pinning in unit tests (6b8c789)
  • Omit the 3rd argument when it’s equal to an empty string (343c153)
  • Add opts.limitLinebreaksCount (55eedfa)

2.12.0

25 Oct 2018
  • Updated all dependencies
  • Restored coveralls.io reporting
  • Restored unit test linting

2.11.0

26 Jul 2018
  • If third argument is an empty string, now it’s being completely omitted. This is necessary for unit tests’ sanity. Otherwise, it’s impossible to deepEqual-match.

2.10.0

3 Jul 2018
  • Added opts.limitLinebreaksCount — this will allow double line breaks resulting in an empty row between the content lines.

2.9.0

18 Jun 2018
  • Rename to ranges-push and migrate to Bitbucket

2.8.0

19 May 2018
  • Fixed second input argument throw error message reporting. Previously, when second argument was of a wrong type, the first argument’s details were reported which caused confusion. Fixed now.
  • Throw error pinning in unit tests. Otherwise we would not be able to prove this feature above is correctly implemented. Both before and after were throwing an error. The correctness is distinguished by which error exactly, (first arg’s wrong type) THROW_ID_09 or (newly added second arg’s wrong type) THROW_ID_10. I’d go as far as to say, if throw pinning was implemented at the beginning, this bug would not have happened.

2.7.0

11 May 2018

Setup refresh.

  • Set up Prettier
  • Removed package.lock and .editorconfig
  • Wired Rollup to remove comments from non-dev builds. This means we can now leave the console.logs in the source code — Rollup will remove them from production code.
  • Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed

2.6.0

24 Feb 2018
  • If null is being .pushed, nothing happens. It won’t throw from now on.

2.5.0

10 Feb 2018
  • Now accepts output of another slices class (its .current() output) as the first input argument. Now, it won’t throw an error that second argument is missing, provided the validation of the array from the 1st argument passes.

    In practice, I’m going to use it in string-remove-duplicate-heads-tails for example, where I there will be two-step process. Range comes in as a plausible range, then we traverse further and if further ranges are found, that plausible-one is merged into the real ranges slices array class. This merging up until now was a problem — it could only be done iterating one array and .pushing each range one-by-one into another slices array.

  • 🔧 Because of the above I had to rewrite the whole validation and error throwing part. All unit tests are the same and more were added, so there shoud not be any breaking changes.

2.4.0

18 Jan 2018
  • opts.limitToBeAddedWhitespace now also collapses the leading and trailing whitespace. If any chunk of leading whitespace (anything that would get trim()‘med) contain line break \n, it’s turned into \n. Otherwise, it’s turned into single space.
// does nothing to trimmed strings:
‘aaa’ => ‘aaa’
// if leading or trailing whitespace doesn’t contain \n, collapse to a single space
‘  aaa   ‘ => ‘ aaa ‘
// otherwise, collapse to a single \n
‘     \n\n   aaa  \n\n\n    ‘ => ‘\naaa\n’

2.3.0

16 Jan 2018
  • .push as an alias for .add. Both do the same thing. I thought the name of this package has “push” so why there is no such method? Until now, that is.

2.2.0

29 Dec 2017
  • When third argument is null, any merged range results will have there null.

2.1.0

20 Dec 2017
  • opts.limitToBeAddedWhitespace — makes life easier when cleaning HTML. Now, chunk ranges can contain any amount of whitespace — the current() will run string-collapse on the to-be-inserted, third argument. Now, if there are any line breaks among the whitespace characters, the result will be a single line break instead. Basically, when this setting is active, only space or linebreak will be inserted in place of deleted range.

What this feature gives you is you can activate it and freely push chunks of string in, extracting whitespace along it and pushing it too. You don’t need to care about excessive amount of it — this library will truncate it automatically. It’s very handy when stripping strings from HTML tags for example.

2.0.0

5 Dec 2017
  • Rewrite in ES modules

  • Now serving three builds: CommonJS, UMD and ES modules, all wired up to appropriate end-points on package.json

  • If you have two ranges where second-one completely overlaps the first-one and the first has third argument, something to insert in its place, that third argument will be discarded upon merge.

    Let’s say you got these two ranges:

    [
      [5, 6, “ “],
      [1, 10],
    ];
    

    Previously, result would be [1, 10, ‘ ‘]. Now result will be [1, 10]. This is logical, because each range should take care to consider its vicinity. If [1, 10] came in without instructions to add something in its place, we assume this was intentional.

1.6.0

25 Sept 2017
  • Actually serving the transpiled version as default. Sorry about that. Now the transpiled source is wired to package.json main. The proper Rollup setup (UMD, ESJ and ESM builds) is in coming next.

1.5.0

18 Sept 2017
  • Separated the merging function into a separate library, ranges-merge.

1.4.0

12 Sept 2017
  • Separated ranges sorting function into a separate library because it will be needed in Detergent.
  • Replaced JS Standard with ESLint on airbnb-base config with two exceptions: 1. no semicolons and 2. allow plus-plus in for-loops. For posterity JS Standard has been neglected by its maintainers, currently it’s using half-year old version of ESLint, and doesn’t tap to majority of its rules. After activating ESLint, it found some style issues that needed fixing. I like that.

1.3.0

30 Aug 2017
  • Transpiled version is available from the folder /es5/.

1.2.0

16 Aug 2017
  • 🔧 The input validation was not passing through the zero indexes for .add() because natural number checks were not including zero. Sorted now.

1.1.0

31 Jul 2017
  • An improvement to the algorithm which doesn’t change API: sorting and merging is now done upon querying .current(), not during .add(). This guarantees maximum data precision, especially if you don’t do any .add() after calling .current() and processing the slices array using string-replace-slices-array.

1.0.0

28 Jul 2017
  • First public release