UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

21 lines (20 loc) 825 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HelpfulZodValidationError = void 0; const HelpfulSchemaValidationError_1 = require("./HelpfulSchemaValidationError"); class HelpfulZodValidationError extends HelpfulSchemaValidationError_1.HelpfulSchemaValidationError { constructor({ error, props, domainObject, }) { const message = ` Errors were found while validating properties for domain object ${domainObject}.: ${JSON.stringify(error.issues, null, 2)} Props Provided: ${JSON.stringify(props, null, 2)} `.trim(); super(message); this.details = error.issues; this.props = props; this.domainObject = domainObject; } } exports.HelpfulZodValidationError = HelpfulZodValidationError; //# sourceMappingURL=HelpfulZodValidationError.js.map