Fixin imports in invert methods. (#3002)

This commit is contained in:
Michał Lipiński
2017-02-13 17:05:18 +01:00
committed by John-David Dalton
parent 3411cce1d2
commit 135cb0ad88
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import baseForOwn from './baseForOwn.js'
import baseForOwn from './.internal/baseForOwn.js'
/**
* Creates an object composed of the inverted keys and values of `object`.

View File

@@ -1,4 +1,4 @@
import baseForOwn from './baseForOwn.js'
import baseForOwn from './.internal/baseForOwn.js'
/** Used to check objects for own properties. */
const hasOwnProperty = Object.prototype.hasOwnProperty
@@ -25,6 +25,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty
function invertBy(object, iteratee) {
const result = {}
baseForOwn(object, (value, key) => {
value = iteratee(value)
if (hasOwnProperty.call(result, value)) {
result[value].push(key)