Fixin loop args order regression from 3c2795b in invertBy.

This commit is contained in:
Michał Lipiński
2017-07-14 13:25:15 +02:00
parent 536f09b68c
commit bcd13b270d

View File

@@ -22,8 +22,8 @@ const hasOwnProperty = Object.prototype.hasOwnProperty
*/ */
function invertBy(object, iteratee) { function invertBy(object, iteratee) {
const result = {} const result = {}
Object.keys(object).forEach((value, key) => { Object.keys(object).forEach((key) => {
value = iteratee(value) const value = iteratee(object[key])
if (hasOwnProperty.call(result, value)) { if (hasOwnProperty.call(result, value)) {
result[value].push(key) result[value].push(key)
} else { } else {