mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Fixin imports in invert methods. (#3002)
This commit is contained in:
committed by
John-David Dalton
parent
3411cce1d2
commit
135cb0ad88
@@ -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`.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user