Make an assertion that obj is not an instance of type. If so, then throw.
obj
type
The type of the object to check.
The type of the class to check against.
The object to check.
The class constructor to check against.
Rest
Optional
The optional message to display if the assertion fails.
import { assertNotInstanceOf } from "@std/assert";assertNotInstanceOf(new Date(), Number); // Doesn't throwassertNotInstanceOf(new Date(), Date); // Throws Copy
import { assertNotInstanceOf } from "@std/assert";assertNotInstanceOf(new Date(), Number); // Doesn't throwassertNotInstanceOf(new Date(), Date); // Throws
Make an assertion that
objis not an instance oftype. If so, then throw.