1 2 3 4 5 6 7 8 9 10 11 12 13 | 1× 1× 9× 9× 9× 26× 26× 9× | const forEach = require('./each') module.exports = function indexedMap (each, fn) { /* istanbul ignore next */ if (typeof each !== 'function') each = forEach.bind(this, each) const result = {} each(function () { const item = fn.apply(this, arguments) result[item[0]] = item[1] }) return result } |