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

Function result

lib/web/jshint.js:11286–11297  ·  view source on GitHub ↗

* This method is like `_.get` except that if the resolved value is a function * it is invoked with the `this` binding of its parent object and its result * is returned. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query.

(object, path, defaultValue)

Source from the content-addressed store, hash-verified

11284 * // => 'default'
11285 */
11286 function result(object, path, defaultValue) {
11287 var result = object == null ? undefined : object[path];
11288 if (result === undefined) {
11289 if (object != null && !isKey(path, object)) {
11290 path = toPath(path);
11291 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
11292 result = object == null ? undefined : object[last(path)];
11293 }
11294 result = result === undefined ? defaultValue : result;
11295 }
11296 return isFunction(result) ? result.call(object) : result;
11297 }
11298
11299 /**
11300 * Sets the property value of `path` on `object`. If a portion of `path`

Callers 2

getCallbackFunction · 0.70
getIndexOfFunction · 0.70

Calls 7

isKeyFunction · 0.85
toPathFunction · 0.85
baseGetFunction · 0.85
baseSliceFunction · 0.85
lastFunction · 0.70
isFunctionFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected