sw

split-with

Returns an array of [takeWhile(pred, coll), dropWhile(pred, coll)]

Showing:

Popularity

Downloads/wk

24

GitHub Stars

0

Maintenance

Last Commit

7d ago

Contributors

5

Package

Dependencies

2

Size (min+gzip)

0.2KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status

split-with

Returns an array of [takeWhile(coll, pred), dropWhile(coll, pred)]

function splitWith(coll, pred, ctx) { }

Install

npm i -S split-with

Usage

var assert = require('assert');
var splitWith = require('split-with');
var is = require('is-predicate');

function gtEq3(val) {
  return is.greaterEq(3, val);
}

var arr = [1, 2, 3, 4, 5];
var expected = [[1, 2, 3], [4, 5]];

assert.deepEqual(splitWith(arr, gtEq3), expected); // true

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial