MCPcopy Create free account
hub / github.com/denoland/std / assertNotInstanceOf

Function assertNotInstanceOf

assert/not_instance_of.ts:23–33  ·  view source on GitHub ↗
(
  actual: A,
  // deno-lint-ignore no-explicit-any
  unexpectedType: abstract new (...args: any[]) => T,
  msg?: string,
)

Source from the content-addressed store, hash-verified

21 * @param msg The optional message to display if the assertion fails.
22 */
23export function assertNotInstanceOf<A, T>(
24 actual: A,
25 // deno-lint-ignore no-explicit-any
26 unexpectedType: abstract new (...args: any[]) => T,
27 msg?: string,
28): asserts actual is Exclude<A, T> {
29 const msgSuffix = msg ? `: ${msg}` : ".";
30 msg =
31 `Expected object to not be an instance of "${typeof unexpectedType}"${msgSuffix}`;
32 assertFalse(actual instanceof unexpectedType, msg);
33}

Callers 2

fnFunction · 0.90
toBeInstanceOfFunction · 0.85

Calls 1

assertFalseFunction · 0.90

Tested by

no test coverage detected