mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Bump to v3.3.0.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var isNative = require('./isNative');
|
||||
var baseIsFunction = require('../internal/baseIsFunction'),
|
||||
isNative = require('./isNative');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]';
|
||||
@@ -32,19 +33,11 @@ var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
|
||||
* _.isFunction(/abc/);
|
||||
* // => false
|
||||
*/
|
||||
function isFunction(value) {
|
||||
// Avoid a Chakra JIT bug in compatibility modes of IE 11.
|
||||
// See https://github.com/jashkenas/underscore/issues/1621 for more details.
|
||||
return typeof value == 'function' || false;
|
||||
}
|
||||
// Fallback for environments that return incorrect `typeof` operator results.
|
||||
if (isFunction(/x/) || (Uint8Array && !isFunction(Uint8Array))) {
|
||||
isFunction = function(value) {
|
||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||
// in older versions of Chrome and Safari which return 'function' for regexes
|
||||
// and Safari 8 equivalents which return 'object' for typed array constructors.
|
||||
return objToString.call(value) == funcTag;
|
||||
};
|
||||
}
|
||||
var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
|
||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||
// in older versions of Chrome and Safari which return 'function' for regexes
|
||||
// and Safari 8 equivalents which return 'object' for typed array constructors.
|
||||
return objToString.call(value) == funcTag;
|
||||
};
|
||||
|
||||
module.exports = isFunction;
|
||||
|
||||
Reference in New Issue
Block a user