* The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee.
(value)
| 3503 | * @returns {Function} Returns the iteratee. |
| 3504 | */ |
| 3505 | function baseIteratee(value) { |
| 3506 | // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. |
| 3507 | // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. |
| 3508 | if (typeof value == 'function') { |
| 3509 | return value; |
| 3510 | } |
| 3511 | if (value == null) { |
| 3512 | return identity; |
| 3513 | } |
| 3514 | if (typeof value == 'object') { |
| 3515 | return isArray(value) |
| 3516 | ? baseMatchesProperty(value[0], value[1]) |
| 3517 | : baseMatches(value); |
| 3518 | } |
| 3519 | return property(value); |
| 3520 | } |
| 3521 | |
| 3522 | /** |
| 3523 | * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. |
no test coverage detected