documentit/node_modules/map-obj
2018-01-05 10:48:13 -08:00
..
index.js installed electron 2018-01-05 10:48:13 -08:00
license installed electron 2018-01-05 10:48:13 -08:00
package.json installed electron 2018-01-05 10:48:13 -08:00
readme.md installed electron 2018-01-05 10:48:13 -08:00

map-obj Build Status

Map object keys and values into a new object

Install

$ npm install --save map-obj

Usage

var mapObj = require('map-obj');

var newObject = mapObj({foo: 'bar'}, function (key, value, object) {
	// first element is the new key and second is the new value
	// here we reverse the order
	return [value, key];
});
//=> {bar: 'foo'}

License

MIT © Sindre Sorhus