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