MCPcopy Create free account
hub / github.com/RubyLouvre/anu / baseIteratee

Function baseIteratee

test/babel.js:5505–5518  ·  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

5503 * @returns {Function} Returns the iteratee.
5504 */
5505 function baseIteratee(value) {
5506 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
5507 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
5508 if (typeof value == 'function') {
5509 return value;
5510 }
5511 if (value == null) {
5512 return identity;
5513 }
5514 if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object') {
5515 return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
5516 }
5517 return property(value);
5518 }
5519
5520 module.exports = baseIteratee;
5521

Callers 4

createFindFunction · 0.85
findIndexFunction · 0.85
findLastIndexFunction · 0.85
mapFunction · 0.85

Calls 4

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

Tested by

no test coverage detected