This function provides a type-safe way to check if a value is an instance of
a given constructor, with proper type narrowing for TypeScript. It combines
the null/object check with instanceof to ensure the value is a valid object
before performing the instance check.
Generic type guard for instanceof checks.
This function provides a type-safe way to check if a value is an instance of a given constructor, with proper type narrowing for TypeScript. It combines the null/object check with instanceof to ensure the value is a valid object before performing the instance check.