Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions jsroot/jsroot_reader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ export function sortArrayOfNumbers(arr) {
export function sortDeep(obj) {
sortArrayOfNumbers(obj); // sort nums inside array

obj.forEach((value) => { if (Array.isArray(value)) sortArrayOfNumbers(value); }); // sort elements inside inner array
obj.forEach((value) => {
// sort elements inside inner array
if (Array.isArray(value)) sortArrayOfNumbers(value);
});

obj.sort((a, b) => {
const len = Math.min(a.length, b.length);
Expand All @@ -122,9 +125,7 @@ export function sortDeep(obj) {

export function pairArrayToMap(arr) {
// sort by key
arr.sort((a, b) =>
String(a.first).localeCompare(String(b.first)),
);
arr.sort((a, b) => String(a.first).localeCompare(String(b.first)));

return Object.fromEntries(
arr.map((p) => [
Expand Down
12 changes: 6 additions & 6 deletions jsroot/structure/cluster_groups/read.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { read, isNewer } from "../../jsroot_reader.mjs";

if (!isNewer("7.11.1")) {
console.log(" -> Skipped structure/cluster_groups: version too low")
console.log(" -> Skipped structure/cluster_groups: version too low");
process.exit();
}

const fields = [
"Int32",
];
const fields = ["Int32"];

const [input = "structure.cluster_groups.root", output = "structure.cluster_groups.json"] =
process.argv.slice(2);
const [
input = "structure.cluster_groups.root",
output = "structure.cluster_groups.json",
] = process.argv.slice(2);

read(input, output, fields);
4 changes: 1 addition & 3 deletions jsroot/structure/clusters/read.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { read } from "../../jsroot_reader.mjs";

const fields = [
"Int32",
];
const fields = ["Int32"];

const [input = "structure.clusters.root", output = "structure.clusters.json"] =
process.argv.slice(2);
Expand Down
2 changes: 1 addition & 1 deletion jsroot/structure/empty/read.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { read, isNewer } from "../../jsroot_reader.mjs";

if (!isNewer("7.11.1")) {
console.log(" -> Skipped structure/empty: version too low")
console.log(" -> Skipped structure/empty: version too low");
process.exit();
}

Expand Down
8 changes: 5 additions & 3 deletions jsroot/types/fundamental/integer/read.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { read, isNewer } from "../../../jsroot_reader.mjs";

if (!isNewer("7.11.1")) {
console.log(" -> Skipped types/fundamental/integer: version too low")
console.log(" -> Skipped types/fundamental/integer: version too low");
process.exit();
}

Expand All @@ -27,7 +27,9 @@ const fields = [
"SplitUInt64",
];

const [input = "types.fundamental.integer.root", output = "types.fundamental.integer.json"] =
process.argv.slice(2);
const [
input = "types.fundamental.integer.root",
output = "types.fundamental.integer.json",
] = process.argv.slice(2);

read(input, output, fields, checkBigInt, { marker: "__BIGINT__" }); // marker is used to write BigInts as string in JSON and then convert to number to avoid precision loss
6 changes: 4 additions & 2 deletions jsroot/types/fundamental/misc/read.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ function convertToNum(value) {

const fields = ["Bit", "Byte", "Char"];

const [input = "types.fundamental.misc.root", output = "types.fundamental.misc.json"] =
process.argv.slice(2);
const [
input = "types.fundamental.misc.root",
output = "types.fundamental.misc.json",
] = process.argv.slice(2);

read(input, output, fields, convertToNum);
6 changes: 4 additions & 2 deletions jsroot/types/fundamental/real/read.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const fields = [
"DoubleSplitReal64",
];

const [input = "types.fundamental.real.root", output = "types.fundamental.real.json"] =
process.argv.slice(2);
const [
input = "types.fundamental.real.root",
output = "types.fundamental.real.json",
] = process.argv.slice(2);

read(input, output, fields, floatToHex);
8 changes: 5 additions & 3 deletions jsroot/types/fundamental/real32quant/read.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { read, floatToHex, isNewer } from "../../../jsroot_reader.mjs";

if (!isNewer("7.11.1")) {
console.log(" -> Skipped types/fundamental/real32quant: version too low")
console.log(" -> Skipped types/fundamental/real32quant: version too low");
process.exit();
}

Expand All @@ -23,7 +23,9 @@ const fields = [
"DoubleReal32Quant32",
];

const [input = "types.fundamental.real32quant.root", output = "types.fundamental.real32quant.json"] =
process.argv.slice(2);
const [
input = "types.fundamental.real32quant.root",
output = "types.fundamental.real32quant.json",
] = process.argv.slice(2);

read(input, output, fields, formatFloat);
6 changes: 4 additions & 2 deletions jsroot/types/fundamental/real32trunc/read.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const fields = [
"DoubleReal32Trunc31",
];

const [input = "types.fundamental.real32trunc.root", output = "types.fundamental.real32trunc.json"] =
process.argv.slice(2);
const [
input = "types.fundamental.real32trunc.root",
output = "types.fundamental.real32trunc.json",
] = process.argv.slice(2);

read(input, output, fields, floatToHex);
4 changes: 4 additions & 0 deletions web/html/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ <h1>Validation-Suite</h1>
overlay.addEventListener('click', (e) => {
if (e.target === overlay) closeModal();
});

document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeModal();
});
}

// open modal and fill it with text
Expand Down