1.0.0 • Published 8 years ago

deindex v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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