MCPcopy Index your code
hub / github.com/Effect-TS/effect / assertInstanceOf

Function assertInstanceOf

packages/effect/test/Schema/SchemaTest.ts:46–55  ·  view source on GitHub ↗
(
    value: unknown,
    constructor: C,
    message?: string,
    ..._: Array<never>
  )

Source from the content-addressed store, hash-verified

44 const config = yield* AssertConfig
45
46 function assertInstanceOf<C extends abstract new(...args: any) => any>(
47 value: unknown,
48 constructor: C,
49 message?: string,
50 ..._: Array<never>
51 ): asserts value is InstanceType<C> {
52 if (!(value instanceof constructor)) {
53 fail(message ?? `expected ${value} to be an instance of ${constructor}`)
54 }
55 }
56
57 const out = {
58 ast: {

Callers 1

parseErrorFunction · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected