mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import baseIsFunction from '../internal/baseIsFunction';
|
||||
import getNative from '../internal/getNative';
|
||||
import root from '../internal/root';
|
||||
import isObject from './isObject';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]';
|
||||
@@ -9,14 +7,11 @@ var funcTag = '[object Function]';
|
||||
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.
|
||||
*
|
||||
@@ -33,11 +28,11 @@ var Uint8Array = getNative(root, 'Uint8Array');
|
||||
* _.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;
|
||||
}
|
||||
|
||||
export default isFunction;
|
||||
|
||||
Reference in New Issue
Block a user