0.0.1 • Published 8 years ago
object-2darray v0.0.1
object-2darray
This module takes an object and returns a 2d array and vice versa.
Installation
> npm install object-2darray
Usage
/**
* params(object || 2d array)
**/
import transform from 'object-2darray';
transform([ ['name', 'Org'], ['age', 13], ['sport', 'soccer'] ]);
// ===> { name: 'Org', age: 13, sport: 'soccer' }
transform({ name: 'Org', age: 13, sport: 'soccer' })
// ===> [ [ 'name', 'Org' ], [ 'age', 13 ], [ 'sport', 'soccer' ] ]
Raison d'être
When tackling large projects, slowing down to write an algorithm to transform objects into 2d arrays or the other way around is annoying. There are no Api to mess with pass in a 2d array or object and get your desired result.
Super Light. No dependencies.
License
0.0.1
8 years ago