map-obj (1.0.1)

Published 2026-02-24 14:01:10 +00:00 by atheaadmin

Installation

registry=
npm install map-obj@1.0.1
"map-obj": "1.0.1"

About this package

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

Dependencies

Development Dependencies

ID Version
ava 0.0.4

Keywords

map obj object key keys value values val iterate iterator
Details
npm
2026-02-24 14:01:10 +00:00
0
Sindre Sorhus
MIT
1.5 KiB
Assets (1)
Versions (2) View all
1.0.1 2026-02-24
4.3.0 2026-02-24