UNPKG

@ticatec/web-bean-validator

Version:

A TypeScript/JavaScript library for rule-based entity validation with boundary checking for strings, numbers, dates, enums, objects, and arrays.

17 lines (16 loc) 340 B
export default class ValidationResult { constructor() { this._valid = true; this._errors = {}; } setError(field, errMessage) { this._valid = false; this._errors[field] = errMessage; } get valid() { return this._valid; } get errors() { return this._errors; } }