A user-defined type guard is a function whose return type is a type predicate (x is T). When it returns true, the compiler narrows the argument to T in the calling code — letting you encapsulate custom runtime checks.
{ (): ; }
{ (): ; }
(): pet is {
pet;
}
() {
((pet)) {
pet.();
} {
pet.();
}
}
