Skip to content

Commit

Permalink
Change isFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed May 14, 2024
1 parent bc03df3 commit 13b5693
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion type.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,23 @@ export function isString(input) {
return typeof input === "string";
}

/**
* Checks if the provided input is a function.
* @param {unknown} input - The input to check.
* @returns {boolean} - True if the input is a function, false otherwise.
*/
export function isFunction(input) {
return typeof input === "function";
}

/**
* isFunction.
* https://github.com/microsoft/TypeScript/pull/23039
* @template T
* @param {T} input
* @returns {value is Extract<T, Function>}
*/
export function isFunction(input) {
export function isNarrowedFunction(input) {
return typeof input === "function";
}

Expand Down

0 comments on commit 13b5693

Please sign in to comment.