assertInstanceOf
import { assertInstanceOf } from "jsr:@ende/assert";function
function assertInstanceOf<T extends new (...args: any[]) => any>(actual: unknown, expectedType: T, msg: string = ): asserts actual is InstanceType<T>Make an assertion that obj is an instance of type.
If not then throw.
actual: unknownThe object to check.
expectedType: TThe expected class constructor.
msg: string =The optional message to display if the assertion fails.
Example: Usage
import { assertInstanceOf } from "@ende/assert";
assertInstanceOf(new Date(), Date); // Doesn't throw
assertInstanceOf(new Date(), Number); // Throws