Works with
•JSR Score70%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
- @std/assert
assert_instance_of
- all symbols
- default
- assert
- assert_almost_equals
- assert_array_includes
- assert_equals
- assert_exists
- assert_false
- assert_greater
- assert_greater_or_equal
- assert_instance_of
- assert_is_error
- assert_less
- assert_less_or_equal
- assert_match
- assert_not_equals
- assert_not_instance_of
- assert_not_match
- assert_not_strict_equals
- assert_object_match
- assert_rejects
- assert_strict_equals
- assert_string_includes
- assert_throws
- assertion_error
- equal
- fail
- unimplemented
- unreachable
Functions
f
assertInstanceOf<T extends AnyConstructor>(): asserts actual is GetConstructorType<T>
actual: unknown,
expectedType: T,
msg?
Make an assertion that obj is an instance of type.
If not then throw.
Type Aliases
T
AnyConstructor = new (...args: any[]) => any
Any constructor
T
GetConstructorType<T extends AnyConstructor> = T extends new (...args: any) => infer C ? C : never
Gets constructor type