CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
isFunction.js38 linesDownload Raw Back to lodash
1var baseGetTag = require('./_baseGetTag'),2    isObject = require('./isObject');3 4/** `Object#toString` result references. */5var asyncTag = '[object AsyncFunction]',6    funcTag = '[object Function]',7    genTag = '[object GeneratorFunction]',8    proxyTag = '[object Proxy]';9 10/**11 * Checks if `value` is classified as a `Function` object.12 *13 * @static14 * @memberOf _15 * @since 0.1.016 * @category Lang17 * @param {*} value The value to check.18 * @returns {boolean} Returns `true` if `value` is a function, else `false`.19 * @example20 *21 * _.isFunction(_);22 * // => true23 *24 * _.isFunction(/abc/);25 * // => false26 */27function isFunction(value) {28  if (!isObject(value)) {29    return false;30  }31  // The use of `Object#toString` avoids issues with the `typeof` operator32  // in Safari 9 which returns 'object' for typed arrays and other constructors.33  var tag = baseGetTag(value);34  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;35}36 37module.exports = isFunction;38 
basant307/AI_Governance_Project · CoolFace