https://github.com/afeiship/next-partition
Creates an array of elements split into two groups.
https://github.com/afeiship/next-partition
next part partition slice
Last synced: about 1 month ago
JSON representation
Creates an array of elements split into two groups.
- Host: GitHub
- URL: https://github.com/afeiship/next-partition
- Owner: afeiship
- License: mit
- Created: 2017-09-21T01:19:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T05:35:43.000Z (about 5 years ago)
- Last Synced: 2025-05-16T02:38:51.487Z (about 1 year ago)
- Topics: next, part, partition, slice
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-partition
> Creates an array of elements split into two groups.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-partition
```
## usage
```js
import '@jswork/next-partition';
const rs = nx.partition([1, 2, 3], function(_, n) {
return n % 2;
});
//result:
[
[1,3],
[2]
]
```
## license
Code released under [the MIT license](https://github.com/afeiship/next-partition/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-partition
[version-url]: https://npmjs.org/package/@jswork/next-partition
[license-image]: https://img.shields.io/npm/l/@jswork/next-partition
[license-url]: https://github.com/afeiship/next-partition/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-partition
[size-url]: https://github.com/afeiship/next-partition/blob/master/dist/next-partition.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-partition
[download-url]: https://www.npmjs.com/package/@jswork/next-partition