Class: ValidationErrors

x2node-validators~ ValidationErrors

Validation errors object. The own enumarable property names are RFC 6901 JSON pointers for the invalid parts of the record (empty string for error about the record as a whole). The values are arrays of corresponding error messages.

new ValidationErrors()

Methods


addError(ptr, message)

Add error.
Parameters:
Name Type Description
ptr string | module:x2node-pointers~RecordElementPointer The pointer.
message string The message.

hasErrors(ptr)

Tell is has errors.
Parameters:
Name Type Description
ptr string | module:x2node-pointers~RecordElementPointer The pointer.
Returns:
true if has errors.
Type
boolean

isEmpty()

Tell if empty.
Returns:
true if empty.
Type
boolean