Function
assertInstanceOf
(
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: { |
Tested by
no test coverage detected