1 | var forEach = require('./each')
|
2 |
|
3 | module.exports = function mapObject (each, fn) {
|
4 | if (typeof each !== 'function') each = forEach.bind(this, each)
|
5 | var result = {}
|
6 | each(function (val, key) { result[key] = fn.apply(this, arguments) })
|
7 | return result
|
8 | }
|