mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['../internal/baseIsFunction', '../internal/getNative', '../internal/root'], function(baseIsFunction, getNative, root) {
|
||||
define(['./isObject'], function(isObject) {
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]';
|
||||
@@ -7,14 +7,11 @@ define(['../internal/baseIsFunction', '../internal/getNative', '../internal/root
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
|
||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/** Native method references. */
|
||||
var Uint8Array = getNative(root, 'Uint8Array');
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Function` object.
|
||||
*
|
||||
@@ -31,12 +28,12 @@ define(['../internal/baseIsFunction', '../internal/getNative', '../internal/root
|
||||
* _.isFunction(/abc/);
|
||||
* // => false
|
||||
*/
|
||||
var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
|
||||
function isFunction(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;
|
||||
};
|
||||
return isObject(value) && objToString.call(value) == funcTag;
|
||||
}
|
||||
|
||||
return isFunction;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user