The Lodash method isFunction exported as a module for checking if a value is classified as a Function object.
npx @tessl/cli install tessl/npm-lodash--isfunction@3.0.0The Lodash method _.isFunction exported as a standalone module for checking if a value is classified as a Function object. This utility provides robust function detection that handles modern JavaScript function types including regular functions, async functions, generator functions, and proxy-wrapped functions while properly handling edge cases and cross-environment compatibility.
npm install lodash.isfunctionCommonJS (primary):
const isFunction = require("lodash.isfunction");ESM (via interop):
import isFunction from "lodash.isfunction";TypeScript:
import isFunction from "lodash.isfunction";
// Note: No built-in TypeScript definitions. Function returns boolean.const isFunction = require("lodash.isfunction");
// Regular functions
isFunction(function() {}); // => true
isFunction(() => {}); // => true
// Async functions
isFunction(async function() {}); // => true
isFunction(async () => {}); // => true
// Generator functions
isFunction(function* () {}); // => true
// Built-in functions
isFunction(Array.prototype.slice); // => true
isFunction(console.log); // => true
// Non-functions
isFunction(/abc/); // => false
isFunction({}); // => false
isFunction("function"); // => false
isFunction(null); // => false
isFunction(undefined); // => falseChecks if a value is classified as a Function object using robust type detection that works across different JavaScript environments.
/**
* Checks if `value` is classified as a `Function` object.
*
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @since 0.1.0
* @category Lang
* @example
*
* const isFunction = require('lodash.isfunction');
*
* isFunction(function() {});
* // => true
*
* isFunction(/abc/);
* // => false
*/
function isFunction(value: any): boolean;Function Types Detected:
function() {})() => {})async function() {}, async () => {})function* () {})Implementation Details:
Object.prototype.toString for reliable type detectionSymbol.toStringTag for custom objectstypeof operator on typed arraysBrowser Compatibility: