mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Bump to v4.16.5.
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
var isObject = require('./isObject');
|
||||
var baseGetTag = require('./_baseGetTag'),
|
||||
isObject = require('./isObject');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]',
|
||||
var asyncTag = '[object AsyncFunction]',
|
||||
funcTag = '[object Function]',
|
||||
genTag = '[object GeneratorFunction]',
|
||||
proxyTag = '[object Proxy]';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Function` object.
|
||||
*
|
||||
@@ -33,10 +25,13 @@ var objectToString = objectProto.toString;
|
||||
* // => 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) ? objectToString.call(value) : '';
|
||||
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
||||
var tag = baseGetTag(value);
|
||||
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
||||
}
|
||||
|
||||
module.exports = isFunction;
|
||||
|
||||
Reference in New Issue
Block a user