dot-expand

Expand key-value pairs whose keys use dot-notation


Keywords
expand, deep, path, property, dot, prop, object, obj, notation, nested
License
MIT
Install
npm install dot-expand@0.0.3

Documentation

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