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