JSPM

  • Created
  • Published
  • Downloads 4491
  • Score
    100M100P100Q126941F
  • License MIT

Convert nested object to flatten or expand.

Package Exports

  • objnest

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (objnest) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

objnest

Build Status Code Climate Code Coverage npm Version

Convert nested object to flatten or expand.

Installation

npm install objnest --save

Usage

Flatten Object Properties

Convert nested object into flatten structure.

var objnest = require('objnest');
var flattened = objnest.flatten({
    'foo': {'bar': 'baz'}
});
console.log(flattened); // => {'foo.bar': 'baz'}

Expand Object Properties

Convert flattened object into nested structure.

var objnest = require('objnest');
var expanded = objnest.expand({
    'foo.bar': 'baz'
});
console.log(expanded); // => {foo: {bar: 'baz'}}

License

This software is released under the MIT License.