UNPKG

256 BJavaScriptView Raw
1var forEach = require('./each')
2
3module.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}