1 var baseIsFunction = require('../internal/baseIsFunction'),
2 isNative = require('./isNative');
4 /** `Object#toString` result references. */
5 var funcTag = '[object Function]';
7 /** Used for native method references. */
8 var objectProto = Object.prototype;
11 * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
14 var objToString = objectProto.toString;
16 /** Native method references. */
17 var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
20 * Checks if `value` is classified as a `Function` object.
25 * @param {*} value The value to check.
26 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
32 * _.isFunction(/abc/);
35 var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
36 // The use of `Object#toString` avoids issues with the `typeof` operator
37 // in older versions of Chrome and Safari which return 'function' for regexes
38 // and Safari 8 equivalents which return 'object' for typed array constructors.
39 return objToString.call(value) == funcTag;
42 module.exports = isFunction;