aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_baseInvoke.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_baseInvoke.js')
-rw-r--r--node_modules/lodash/_baseInvoke.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/node_modules/lodash/_baseInvoke.js b/node_modules/lodash/_baseInvoke.js
index 3d6bca5db..49bcf3c35 100644
--- a/node_modules/lodash/_baseInvoke.js
+++ b/node_modules/lodash/_baseInvoke.js
@@ -1,6 +1,5 @@
var apply = require('./_apply'),
castPath = require('./_castPath'),
- isKey = require('./_isKey'),
last = require('./last'),
parent = require('./_parent'),
toKey = require('./_toKey');
@@ -16,12 +15,9 @@ var apply = require('./_apply'),
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
- if (!isKey(path, object)) {
- path = castPath(path);
- object = parent(object, path);
- path = last(path);
- }
- var func = object == null ? object : object[toKey(path)];
+ path = castPath(path, object);
+ object = parent(object, path);
+ var func = object == null ? object : object[toKey(last(path))];
return func == null ? undefined : apply(func, object, args);
}