indexBy.js 279 B

123456789
  1. var _group = require('./_group.js');
  2. // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
  3. // when you know that your index values will be unique.
  4. var indexBy = _group(function(result, value, key) {
  5. result[key] = value;
  6. });
  7. module.exports = indexBy;