@f/map-keys
v1.0.0
Published
Map the keys of an object.
Downloads
1
Readme
map-keys
Map the keys of an object.
Installation
$ npm install @f/map-keys
Usage
var mapKeys = require('@f/map-keys')
mapKeys(map, {foo: 'bar', qux: 'bat'}) // => {bar: 'bar', qux: 'bat'}
function map (key) {
return key === 'foo' ? 'bar' : key
}
API
mapKeys(fn, obj)
fn
- mapping functionobj
- object to map keys of
Returns: an object whose keys have been mapped by fn
License
MIT