@monstermann/fn
Version:
A utility library for TypeScript.
24 lines (22 loc) • 462 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/function/isFunction.ts
/**
* `isFunction(target)`
*
* Checks if a value is a function.
*
* ```ts
* isFunction(() => {}); // true
* isFunction("not a function"); // false
* ```
*
* ```ts
* pipe(() => {}, isFunction()); // true
* pipe("not a function", isFunction()); // false
* ```
*/
const isFunction = dfdlT((target) => {
return typeof target === "function";
}, 1);
//#endregion
export { isFunction };