UNPKG

underscore-es

Version:

javaScript's functional programming helper library for ES6 and beyond.

12 lines (9 loc) 354 B
// `_indexBy` : a collection's function // ------------------------------------ import {group} from './_internal'; // Indexes the object's values by a criterion, similar to `groupBy`, but for // when you know that your index values will be unique. var _indexBy = group( (result, value, key) => { result[key] = value; }); export {_indexBy as default};