UNPKG

@vitruvius-labs/ts-predicate

Version:
8 lines (7 loc) 302 B
import { ValidationError } from "./utils/validation-error.mjs"; function assertInstanceOf(value, constructor_class) { if (!(value instanceof constructor_class)) { throw new ValidationError(`The value must be an instance of ${constructor_class.name}.`); } } export { assertInstanceOf };