split-props

1.0.0 • Public • Published

split-props

Creates an array of objects reducing property values by index successively

Build Status npm version

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

Package Sidebar

Install

npm i split-props

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • willhoag