* The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee.
(value)
| 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. |
no test coverage detected