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 
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
Assets (1)
Versions (2)
View all
map-obj-1.0.1.tgz
1.5 KiB