FlyUp/packages/字体精简工具/node_modules/map-obj
2024-07-10 18:24:08 +08:00
..
index.js 增加分享 2024-07-10 18:24:08 +08:00
license 增加分享 2024-07-10 18:24:08 +08:00
package.json 增加分享 2024-07-10 18:24:08 +08:00
readme.md 增加分享 2024-07-10 18:24:08 +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