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

@extra-iterable/cut-right.min

2.5.12 • Public • Published

Breaks iterable after test passes. 🏃 📼 📦 🌔 📒

Alternatives: cut, cutRight, cutAt, cutAtRight.
Similar: cut, split, group.
This is part of package extra-iterable.

This is browserified, minified version of @extra-iterable/cut-right.
It is exported as global variable iterable_cutRight.
CDN: unpkg, jsDelivr.

iterable.cutRight(x, ft);
// x:  an iterable
// ft: test function (v, i, x)
const iterable = require('extra-iterable');
 
var x = [1, 2, 3, 4, 5];
[...iterable.cutRight(x, v => v % 2 === 0)];
// [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ]
 
[...iterable.cutRight(x, v => v % 2 === 1)];
// [ [ 1 ], [ 2, 3 ], [ 4, 5 ], [] ]

references

Install

npm i @extra-iterable/cut-right.min

DownloadsWeekly Downloads

1,319

Version

2.5.12

License

MIT

Unpacked Size

7.6 kB

Total Files

14

Last publish

Collaborators

  • avatar