UNPKG

blow-validate

Version:
32 lines (31 loc) 709 B
'use strict'; class ValidationError { constructor(errorRaw) { this._property = errorRaw.property; this._type = errorRaw.type; this._message = errorRaw.message.replace(/"/g, '\''); } get property() { return this._property; } get type() { return this._type; } get message() { return this._message; } toJSON() { return { property: this._property, type: this._type, message: this._message }; } inspect() { return this.toJSON(); } static create(errorRaw) { return new ValidationError(errorRaw); } } exports.ValidationError = ValidationError;