split-props
v1.0.0
Published
creates an array of objects reducing property values by index successively
Downloads
20
Maintainers
Readme
split-props
Creates an array of objects reducing property values by index successively
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install split-props --save
Description
Loops through the object multiple times (returning an array of objects) mapping the next value from each property to the property's key.
Usage
// require module
var splitProps = require('split-props');
splitProps({
a: ['a', 'b', 'c'],
b: [2, 3]
})
/* returns [
{ a: 'a', b: 2 },
{ a: 'b', b: 3 },
{ a: 'c', b: undefined }
] */
License
MIT