npm.io
1.0.0 • Published 10 years ago

deindex

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

deindex Build Status

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

Keywords