expand-object-keys

2.0.0 • Public • Published

expand-object-keys Build Status

Expand dotty object keys to objects

Install

$ npm install --save expand-object-keys

Usage

import expandObjectKeys from 'expand-object-keys';


const obj = {
  'profile.name': 'myname',
  'profile.email': 'myname@gmail.com',
  'profile.address.street': 'Home address',
  'profile.address.zip': '1234',
  mac: 'some mac',
  dist: 'fedora 22'
};

const newObj = expandObjectKeys(obj);

console.log(newObj); // =>
                     // {
                     //   profile: {
                     //     name: 'myname',
                     //     email: 'myname@gmail.com',
                     //     address: {
                     //       street: 'Home address',
                     //       zip: '1234'
                     //     },
                     //   },
                     //   mac: 'some mac',
                     //   dist: 'fedora 22'
                     // };

License

MIT © Stoeffel

Readme

Keywords

none

Package Sidebar

Install

npm i expand-object-keys

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • schtoeffel