Invert string index ranges
This package is pure ESM. If you're not ready yet, install an older version of this program, 4.1.0 (npm i ranges-invert@4.1.0
).
npm i ranges-invert
import { strict as assert } from "assert";
import { rInvert } from "ranges-invert";
assert.deepEqual(
rInvert(
[
[3, 5],
[5, 7],
],
9, // string length needed to set the boundary
),
[
[0, 3],
[7, 9],
],
);
Please visit codsen.com for a full description of the API.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License.
Copyright © 2010-2024 Roy Revelt and other contributors.