object-transpose
Transpose between object of arrays and array of objects
Last updated 4 years ago by emilbay .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install object-transpose 
SYNC missed versions from official npm registry.

Object Transpose

build status NPM version

Transpose between array of objects and object of arrays. Supports objects of sparse arrays and arrays of irregular objects.

See test.js for examples.

Installation

npm install --save object-transpose

Example

var assert = require('assert');
var T = require('object-transpose');

var collection = [
   { a: 1, b: 10 },
   { a: 2, b: 20}
];

assert.deepEqual(T(collection), { a: [1, 2], b: [10, 20] });
assert.deepEqual(T(T(collection)), collection);

License

ISC

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

3 Versions

  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |