Defines the signature for functions that perform runtime type checking while providing compile-time type narrowing.
When the function returns true, TypeScript narrows the value to type T in subsequent code.
Type Parameters
T = unknown
The type that the guard narrows to, defaults to unknown
A type guard function.
Defines the signature for functions that perform runtime type checking while providing compile-time type narrowing. When the function returns
true, TypeScript narrows the value to typeTin subsequent code.