Omit '(root)' specifier entirely
This commit is contained in:
parent
1cc19bff3e
commit
27beee88f0
|
@ -23,6 +23,7 @@
|
||||||
"@validatem/normalize-rules": "^0.1.0",
|
"@validatem/normalize-rules": "^0.1.0",
|
||||||
"@validatem/required": "^0.1.0",
|
"@validatem/required": "^0.1.0",
|
||||||
"@validatem/validation-result": "^0.1.1",
|
"@validatem/validation-result": "^0.1.1",
|
||||||
|
"as-expression": "^1.0.0",
|
||||||
"assure-array": "^1.0.0",
|
"assure-array": "^1.0.0",
|
||||||
"create-error": "^0.3.1",
|
"create-error": "^0.3.1",
|
||||||
"default-value": "^1.0.0",
|
"default-value": "^1.0.0",
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
const indentString = require("indent-string");
|
const indentString = require("indent-string");
|
||||||
const supportsColor = require("supports-color");
|
const supportsColor = require("supports-color");
|
||||||
const matchVirtualProperty = require("@validatem/match-virtual-property");
|
const matchVirtualProperty = require("@validatem/match-virtual-property");
|
||||||
|
const asExpression = require("as-expression");
|
||||||
|
|
||||||
const AggregrateValidationError = require("./aggregrate-validation-error");
|
const AggregrateValidationError = require("./aggregrate-validation-error");
|
||||||
|
|
||||||
|
@ -47,10 +48,21 @@ function renderErrorList(errors, isSubErrors = false) {
|
||||||
? "├─"
|
? "├─"
|
||||||
: "└─";
|
: "└─";
|
||||||
|
|
||||||
let mainLine = (isSubErrors)
|
let mainLine = asExpression(() => {
|
||||||
// ? `... -> ${joinPathSegments(pathSegments)}: ${error.message}`
|
if (pathSegments.length > 0) {
|
||||||
? ` ${lineCharacter} ${joinPathSegments(pathSegments)}: ${error.message}`
|
if (isSubErrors) {
|
||||||
: ` - At ${joinPathSegments(pathSegments)}: ${error.message}`;
|
return ` ${lineCharacter} ${joinPathSegments(pathSegments)}: ${error.message}`;
|
||||||
|
} else {
|
||||||
|
return ` - At ${joinPathSegments(pathSegments)}: ${error.message}`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isSubErrors) {
|
||||||
|
return ` ${lineCharacter} ${error.message}`;
|
||||||
|
} else {
|
||||||
|
return ` - ${error.message}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (error.subErrors != null && error.subErrors.length > 0) {
|
if (error.subErrors != null && error.subErrors.length > 0) {
|
||||||
let renderedSubErrors = renderErrorList(error.subErrors, true);
|
let renderedSubErrors = renderErrorList(error.subErrors, true);
|
||||||
|
|
Loading…
Reference in a new issue