domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
16 lines • 913 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelpfulSchemaValidationError = void 0;
const helpful_errors_1 = require("helpful-errors");
/**
* .what = common base for every schema-library validation error (zod, joi, yup, ...)
* .why = lets a single `instanceof HelpfulSchemaValidationError` recognize any schema
* validation failure. a new schema library extends this base — no consumer of the
* check (e.g. try-each hydration) needs to enumerate a closed list of libraries
* .note = extends ConstraintError — a schema validation failure means the caller supplied
* props that violate the declared shape (their fault), so exit code 2 + http 400 fit
*/
class HelpfulSchemaValidationError extends helpful_errors_1.ConstraintError {
}
exports.HelpfulSchemaValidationError = HelpfulSchemaValidationError;
//# sourceMappingURL=HelpfulSchemaValidationError.js.map