unflatten-array
v1.0.1
Published
Unflatten an single-level list based on a pattern
Downloads
4
Readme
Unflatten
Unflatten an single-level list based on a pattern
Setup
npm install unflatten-array
Usage
var unflatten = require('unflatten-array');
var flatList = [1, 2, 3, 4];
var arrayPattern = [['it', 'can'],['be', 'anything']];
unflatten(flatList, arrayPattern); // [[1, 2], [3, 4]
Lodash mixin
_.mixin({
unflatten: require('unflatten-array')
})