Return true if the given value is a function.
isFunction(0); // => falseisFunction(() => {}); // => trueisFunction(function () {}); // => trueisFunction(async function () {}); // => trueisFunction(class {}); // => false
npx atmx add helper is-function
Copy and paste the following method into @/utils/helpers/undefined.ts:
@/utils/helpers/undefined.ts
/*** Return true if the given value is a function.** @example* isFunction(0) // => false* isFunction(() => {}) // => true* isFunction(function() {}) // => true* isFunction(async function() {}) // => true* isFunction(class {}) // => false*/// biome-ignore lint/complexity/noBannedTypes:export function isFunction(value: any): value is Function {return typeof value === "function";}