expand-object-keys
v2.0.0
Published
Expand dotty object keys to objects
Downloads
4
Readme
expand-object-keys
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': '[email protected]',
'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: '[email protected]',
// address: {
// street: 'Home address',
// zip: '1234'
// },
// },
// mac: 'some mac',
// dist: 'fedora 22'
// };
License
MIT © Stoeffel