FGRibreau / FGRibreau/array-split-by
Open to a third argument to keep the elements to split at?
オープン
- 主要言語
- JavaScript
- スター
- 2
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。