deindex
v1.0.0
Published
Flatten an object with `index` keys
Downloads
3
Readme
deindex
Flatten an object with
index
keys
Useful for representing modular folder structures with index.*
files as the "main" file in a proper tree.
Install
$ npm install --save deindex
Usage
var deindex = require('deindex')
deindex({foo: {bar: {index: 'baz'}}})
//=> {foo: {bar: 'baz'}}
API
deindex(obj)
-> object
obj
Required
Type: object
Traverses the object and returns a new object with lone index
keys flattened out.
License
MIT © Ben Drucker