UNPKG

todo-usecase

Version:
19 lines 589 B
export class ValidationError { rule; field; customMessage; constructor(rule, field, customMessage) { this.rule = rule; this.field = field; if (customMessage !== undefined && customMessage !== null) { this.customMessage = customMessage; } } toString() { if (this.customMessage !== undefined && this.customMessage !== null) { return this.customMessage; } return `Validation failed for field "${this.field}" with rule "${this.rule}".`; } } //# sourceMappingURL=validation-error.js.map