Skip to content

Commit b55455a

Browse files
committed
refactored
1 parent 053c03e commit b55455a

File tree

3 files changed

+1010
-951
lines changed

3 files changed

+1010
-951
lines changed

bin/rdap-validator

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import rdapValidator from "../lib/rdap-validator.js";
3434
import XMLHttpRequest from "xmlhttprequest";
3535

3636
const jsonResultData = {
37+
rdapValidatorVersion: rdapValidator.version,
3738
testedURL: url,
3839
expectedResponseType: responseType,
3940
serverType: serverType,
@@ -44,7 +45,7 @@ rdapValidator.setXHR(XMLHttpRequest.XMLHttpRequest);
4445

4546
let lastPath = null;
4647

47-
const cliResultCallback = function(result, message, context, path) {
48+
const cliResultCallback = function(result, message, path) {
4849
const indentString = " ";
4950
const onlyErrors = opt.named.hasOwnProperty("only-errors");
5051
const indent = indentString.repeat(onlyErrors ? 0 : Math.max(0, rdapValidator.path.length-1));
@@ -54,10 +55,6 @@ const cliResultCallback = function(result, message, context, path) {
5455

5556
console.log(indent + "\x1b[1;31m✘\x1b[0m " + message);
5657

57-
if (context !== undefined) {
58-
console.log("\n" + indentString + indentString + indent + JSON.stringify(context, null, 2).trimEnd().replaceAll("\n", "\n" + indentString + indentString + indent) + "\n");
59-
}
60-
6158
} else if (false === onlyErrors) {
6259
if (true === result) {
6360
console.log(indent + "\x1b[1;32m✓\x1b[0m " + message);
@@ -69,12 +66,11 @@ const cliResultCallback = function(result, message, context, path) {
6966
}
7067
};
7168

72-
const jsonResultCallback = function(result, message, context, path) {
69+
const jsonResultCallback = function(result, message, path) {
7370
jsonResultData.results.push({
7471
testPassed: result,
75-
message: message,
76-
context: context,
77-
path: path,
72+
message: message,
73+
path: path,
7874
});
7975
};
8076

0 commit comments

Comments
 (0)