dot-expand

0.0.3 • Public • Published

dot-expand

Installation

Expand key-value pairs whose keys are in dot notation (.e.g, users.name) into objects.

npm i dot-expand --save
 
yarn add dot-expand

Example

import expand from 'dot-expand'
 
const pojo = expand({
  'users.df01d9e5.name': 'Tom',
  'users.df01d9e5.age': 37
})
 
// => { users: { df01d9e5: { name: 'Tom', age: 37 } } }

/dot-expand/

    Package Sidebar

    Install

    npm i dot-expand

    Weekly Downloads

    45

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    145 kB

    Total Files

    6

    Last publish

    Collaborators

    • menubar