8889841chome/clixcotz/mars.clix.co.tz/node_modules/collect.js/src/methods/mapToDictionary.js000066600000000531150535763510024717 0ustar00'use strict'; module.exports = function mapToDictionary(fn) { const collection = {}; this.items.forEach((item, k) => { const [key, value] = fn(item, k); if (collection[key] === undefined) { collection[key] = [value]; } else { collection[key].push(value); } }); return new this.constructor(collection); };