array-partitioner
v1.0.2
Published
array-partitioner partitions arrays in subarrays with specified length
Downloads
1
Readme
array-partitioner
array-partitioner partitions arrays in sub-arrays with specified length.
Usage
import partitionArray from 'array-partitioner';
partitionArray([1, 2, 3, 4, 5, 6], 3); // --> [[1, 2, 3], [4, 5, 6]]
partitionArray([1, 2, 3, 4, 5], 2); // --> [[1, 2], [3, 4], [5]]
Dev
Lint
Based on eslint and extending the Airbnb-Style Guide.
yarn run lint
Test
By using Jest
yarn run test
Build
yarn run build