|
|
|
@ -4,6 +4,9 @@ const matchVirtualProperty = require("@validatem/match-virtual-property");
|
|
|
|
|
|
|
|
|
|
const AggregrateValidationError = require("./aggregrate-validation-error");
|
|
|
|
|
|
|
|
|
|
// TODO: Omit the "At (root)" for path-less errors, to avoid confusion when singular values are being compared?
|
|
|
|
|
// TODO: Move out the path generating logic into a separate module, to better support custom error formatting code
|
|
|
|
|
|
|
|
|
|
module.exports = function aggregrateAndThrowErrors(errors) {
|
|
|
|
|
let rephrasedErrors = errors.map((error) => {
|
|
|
|
|
let stringifiedPathSegments = error.path.map((segment) => {
|
|
|
|
|