Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    expand-object-keyspublic

    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

    Keywords

    none

    install

    npm i expand-object-keys

    Downloadsweekly downloads

    3

    version

    2.0.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar