0.0.3 • Published 5 years ago

dot-expand v0.0.3

Weekly downloads
27
License
MIT
Repository
github
Last release
5 years ago

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 } } }