mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Tweak exit early in _.isFunction.
This commit is contained in:
@@ -11638,9 +11638,12 @@
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
|
if (!isObject(value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 9 which returns 'object' for typed array and other constructors.
|
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
||||||
var tag = isObject(value) ? baseGetTag(value) : '';
|
var tag = baseGetTag(value);
|
||||||
return tag == funcTag || tag == genTag || tag == proxyTag;
|
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user