as

as/array and as/object. Convert easily, back and forth.

as

as/array and as/object. Convert easily, back and forth.

  • Brings all functional goodness of arrays to objects.
  • Brings the flexibility of objects to arrays.
  • Works well with a functional programming library, like 101.
$ npm install as
var asArray = require("as/array");
var asObject = require("as/object");
asArray(
  {a: 1, b: 2}
  );
// [ {key: "a", value: 1} 
// , {key: "b", value: 2} 
// ] 
asObject(
  [ {key: "a", value: 1}
  , {key: "b", value: 2}
  ]);
// {a: 1, b: 2} 

MIT © Tomek Wiszniewski.