FGRibreau / FGRibreau/array-split-by
Open to a third argument to keep the elements to split at?
Open
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes you want to keep the element that causes the split (i.e., that the iteratee evaluates to true), i.e.,
```js
splitBy([1, 2, 3, "|", 4, 5, 6], val => val === "|", true); // [[1, 2, 3], ["|", 4, 5, 6]]
// ^^^^ NEW ^^^ NEW
```
Would you be open to accepting a pull request that implements this? The third argument could be called `keepSeparator` or something?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.