UNPKG

@discipl/law-reg

Version:

Discipl Law and Regulation Compliance Library

29 lines (25 loc) 894 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValidationError = void 0; class ValidationError { /** * Construct a new validation error. * @param {string} code - Unique code to relate back to the error * @param {string} message - Human readable message describing the problem * @param {Array<number>} offset - Begin and end offset of the error * @param {('ERROR'|'WARNING')} severity - Severity of the error * @param {string|undefined} source - Text that relates to the cause of the error * @param {Array<string|number>|undefined} path - Path to the error */ constructor(code, message, offset, severity, source, path) { this.code = code; this.message = message; this.offset = offset; this.severity = severity; this.source = source; this.path = path; } } exports.ValidationError = ValidationError;