Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed May 14, 2024
1 parent 13b5693 commit 5f12d57
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions type.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,21 @@ export function isString(input) {
/**
* 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.
* @returns {input is Function} - True if the input is a function,
* otherwise false.
*/
export function isFunction(input) {
return typeof input === "function";
}

/**
* isFunction.
* isNarrowedFunction
* Checks if the provided input is a callable function and narrows its type to a
* callable entity. This function uses TypeScript's advanced type narrowing feature
* to ensure that the input is not only a function but also can be called as such.
* https://github.com/microsoft/TypeScript/pull/23039
* @template T
* @template T
* @param {T} input
* @returns {value is Extract<T, Function>}
*/
Expand Down

0 comments on commit 5f12d57

Please sign in to comment.