(input: unknown): input is FunctionChecks whether a value is a function.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
callable function.
Details
Uses typeof input === "function".
Example (Guarding functions)
import { Predicate } from "effect"
const data: unknown = () => 1
if (Predicate.isFunction(data)) {
console.log(data())
}guardsisObjectKeyword
Source effect/Predicate.ts:7363 lines
export function function isFunction(
input: unknown
): input is Function
Checks whether a value is a function.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
callable function.
Details
Uses typeof input === "function".
Example (Guarding functions)
import { Predicate } from "effect"
const data: unknown = () => 1
if (Predicate.isFunction(data)) {
console.log(data())
}
isFunction(input: unknowninput: unknown): input: unknowninput is Function {
return typeof input: unknowninput === "function"
}Referenced by 6 symbols