chunk-pattern
Chunk an array in a specific pattern.
Usage
const flavors = 'Chocolate' 'Strawberry' 'Green Tea' 'Rocky Road' 'Salted Caramel' 'Vanilla' 'Cheese' 'Kit Kat' 'Ube' 'Pandan' 'Blueberry' console /* ['Chocolate', 'Strawberry'], ['Green Tea', 'Rocky Road', 'Salted Caramel'], ['Vanilla', 'Cheese'], ['Kit Kat', 'Ube', 'Pandan'], ['Blueberry'] */
Installation
npm i chunk-pattern --save
API
: Array<Array<mixed>>
Parameters
array
is the array to be chunked in givenpattern
.pattern
is the sequence in which you'd like your array to be chunked.
Contributing
# Run tests npm run test # Create dist build npm run build # Format with Prettier npm run fmt # Run flow npm run flow