function assertInstanceOf
assertInstanceOf<T extends AnyConstructor>(actual: unknown,expectedType: T,msg?): asserts actual is GetConstructorType<T>Make an assertion that obj is an instance of type.
If not then throw.
Examples
Example 1
Example 1
import { assertInstanceOf } from "@std/assert/assert_instance_of"; assertInstanceOf(new Date(), Date); // Doesn't throw assertInstanceOf(new Date(), Number); // Throws
Type Parameters
T extends AnyConstructorParameters
Return Type
asserts actual is GetConstructorType<T>