remeda
Version:
A utility library for JavaScript and Typescript.
1 lines • 813 B
Source Map (JSON)
{"version":3,"file":"isFunction.cjs","names":[],"sources":["../src/isFunction.ts"],"sourcesContent":["import type { NarrowedTo } from \"./internal/types/NarrowedTo\";\nimport type { StrictFunction } from \"./internal/types/StrictFunction\";\n\n/**\n * A function that checks if the passed parameter is a Function and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Function, false otherwise.\n * @signature\n * R.isFunction(data)\n * @example\n * R.isFunction(() => {}) //=> true\n * R.isFunction('somethingElse') //=> false\n * @category Guard\n */\nexport const isFunction = <T>(\n data: StrictFunction | T,\n): data is NarrowedTo<T, StrictFunction> => typeof data === \"function\";\n"],"mappings":"AAeA,MAAa,EACX,GAC0C,OAAO,GAAS"}