MCPcopy
hub / github.com/Kong/insomnia / baseIteratee

Function baseIteratee

packages/insomnia/bin/yarn-standalone.js:11111–11126  ·  view source on GitHub ↗

* The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee.

(value)

Source from the content-addressed store, hash-verified

11109 * @returns {Function} Returns the iteratee.
11110 */
11111 function baseIteratee(value) {
11112 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
11113 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
11114 if (typeof value == 'function') {
11115 return value;
11116 }
11117 if (value == null) {
11118 return identity;
11119 }
11120 if (typeof value == 'object') {
11121 return isArray(value)
11122 ? baseMatchesProperty(value[0], value[1])
11123 : baseMatches(value);
11124 }
11125 return property(value);
11126 }
11127
11128 /**
11129 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.

Callers 1

iterateeFunction · 0.85

Calls 4

isArrayFunction · 0.85
baseMatchesPropertyFunction · 0.85
baseMatchesFunction · 0.85
propertyFunction · 0.85

Tested by

no test coverage detected