Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

ranges-crop

2.1.3 • Public • Published

ranges-crop

Crop array of ranges when they go beyond the reference string's length

Install

npm i ranges-crop

Quick Take

import { strict as assert } from "assert";
import crop from "ranges-crop";
 
assert.deepEqual(
  crop(
    [
      [2, 3],
      [9, 10, "bad grey wolf"],
      [1, 2],
    ],
    7
  ),
  [[1, 3]] // sorted, merged and cropped
);

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-crop

DownloadsWeekly Downloads

181

Version

2.1.3

License

MIT

Unpacked Size

36.8 kB

Total Files

10

Last publish

Collaborators

  • avatar