Miss any of our Open RFC calls?Watch the recordings here! »

ranges-process-outside

2.2.35 • Public • Published

ranges-process-outside

Iterate string considering ranges, as if they were already applied

Install

npm i ranges-process-outside

Quick Take

import { strict as assert } from "assert";
import processOutside from "ranges-process-outside";
 
const gathered = [];
 
// a callback interface:
processOutside(
  "abcdefghij",
  [
    [1, 5], // delete from "b" to "f"
  ],
  (fromIdx, toIdx, offsetValueCb) => {
    gathered.push(fromIdx);
  }
);
 
assert.deepEqual(gathered, [0, 5, 6, 7, 8, 9]);

Documentation

Please visit codsen.com for a full description of the API and examples.

Licence

MIT License

Copyright (c) 2010-2020 Roy Revelt and other contributors

ok codsen star

Install

npm i ranges-process-outside

DownloadsWeekly Downloads

20

Version

2.2.35

License

MIT

Unpacked Size

55.3 kB

Total Files

10

Last publish

Collaborators

  • avatar