flatify-obj
Flatten nested javascript objects into a single-depth object.
Install
npm install flatify-obj
Usage
const flatifyObject = ; //=> { 'foo.bar.unicorn': '🦄' } ; //=> {unicorn: '🦄', bar: 'unicorn'}
API
flatifyObject(object, options?)
object
Type: object
Object to flatten
options
onlyLeaves
Type: boolean
Default: false
Removes the parent property and only returns the leaf nodes of the object