MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / invokePath

Function invokePath

lib/web/jshint.js:5602–5610  ·  view source on GitHub ↗

* Invokes the method at `path` on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the

(object, path, args)

Source from the content-addressed store, hash-verified

5600 * @returns {*} Returns the result of the invoked method.
5601 */
5602 function invokePath(object, path, args) {
5603 if (object != null && !isKey(path, object)) {
5604 path = toPath(path);
5605 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
5606 path = last(path);
5607 }
5608 var func = object == null ? object : object[path];
5609 return func == null ? undefined : func.apply(object, args);
5610 }
5611
5612 /**
5613 * Checks if `value` is a valid array-like index.

Callers 1

runInContextFunction · 0.85

Calls 6

isKeyFunction · 0.85
toPathFunction · 0.85
baseGetFunction · 0.85
baseSliceFunction · 0.85
lastFunction · 0.70
applyMethod · 0.65

Tested by

no test coverage detected