
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
array-split-by
Advanced tools
This function is like [split](https://lodash.com/docs/4.17.10#split) except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the separation is computed
splitBy - `splitBy(array, iteratee)`
Like String.prototype.split except that it works on array and accepts an iteratee which is invoked for each element in array to generate the criterion by which the separation is computed. The order of result values is determined by the order they occur in the array. The iteratee is invoked with three argument: (value, index, chunk, array)
Install with npm.
npm install --save array-split-by
const splitBy = require('splitby');
splitBy([1, 2, 3, "|", 4, 5, 6], val => val === "|"); // [[1, 2, 3], [4, 5, 6]]
splitBy([1, 2, 3], val => val % 2 === 0); // [[1], [3]]
splitBy([{x:0, a:true}, {x:1, a:true}, {x:2, a:false}, {x:1, a:true}], (val) => !val.a); // [[{"a": true, "x": 0}, {"a": true, "x": 1}], [{"a": true, "x": 1}]
COVERALLS_REPO_TOKEN
, create it with: https://coveralls.io/I maintain this project in my free time, if it helped you, well, I would be grateful to buy a beer thanks to your paypal or Bitcoins, donation!
FAQs
This function is like [split](https://lodash.com/docs/4.17.10#split) except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the separation is computed
The npm package array-split-by receives a total of 164 weekly downloads. As such, array-split-by popularity was classified as not popular.
We found that array-split-by demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.