From d79c1b6da513e7fd284e66499270581e9bd8af28 Mon Sep 17 00:00:00 2001 From: Jad Dayoub Date: Tue, 11 Aug 2026 11:44:32 +0200 Subject: [PATCH] Add default values for input and output in types/fundamental --- jsroot/types/fundamental/integer/read.mjs | 4 +++- jsroot/types/fundamental/misc/read.mjs | 4 +++- jsroot/types/fundamental/real/read.mjs | 4 +++- jsroot/types/fundamental/real32quant/read.mjs | 4 +++- jsroot/types/fundamental/real32trunc/read.mjs | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/jsroot/types/fundamental/integer/read.mjs b/jsroot/types/fundamental/integer/read.mjs index b5bf7f3..0385caa 100644 --- a/jsroot/types/fundamental/integer/read.mjs +++ b/jsroot/types/fundamental/integer/read.mjs @@ -27,5 +27,7 @@ const fields = [ "SplitUInt64", ]; -const [input, output] = 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 diff --git a/jsroot/types/fundamental/misc/read.mjs b/jsroot/types/fundamental/misc/read.mjs index 217ee83..3410a8e 100644 --- a/jsroot/types/fundamental/misc/read.mjs +++ b/jsroot/types/fundamental/misc/read.mjs @@ -7,5 +7,7 @@ function convertToNum(value) { const fields = ["Bit", "Byte", "Char"]; -const [input, output] = process.argv.slice(2); +const [input = "types.fundamental.misc.root", output = "types.fundamental.misc.json"] = + process.argv.slice(2); + read(input, output, fields, convertToNum); diff --git a/jsroot/types/fundamental/real/read.mjs b/jsroot/types/fundamental/real/read.mjs index 405af23..9afd4fd 100644 --- a/jsroot/types/fundamental/real/read.mjs +++ b/jsroot/types/fundamental/real/read.mjs @@ -11,5 +11,7 @@ const fields = [ "DoubleSplitReal64", ]; -const [input, output] = process.argv.slice(2); +const [input = "types.fundamental.real.root", output = "types.fundamental.real.json"] = + process.argv.slice(2); + read(input, output, fields, floatToHex); diff --git a/jsroot/types/fundamental/real32quant/read.mjs b/jsroot/types/fundamental/real32quant/read.mjs index f5cab06..74bee6b 100644 --- a/jsroot/types/fundamental/real32quant/read.mjs +++ b/jsroot/types/fundamental/real32quant/read.mjs @@ -9,5 +9,7 @@ const fields = [ "DoubleReal32Quant32", ]; -const [input, output] = process.argv.slice(2); +const [input = "types.fundamental.real32quant.root", output = "types.fundamental.real32quant.json"] = + process.argv.slice(2); + read(input, output, fields, floatToHex); diff --git a/jsroot/types/fundamental/real32trunc/read.mjs b/jsroot/types/fundamental/real32trunc/read.mjs index 3b1d598..ca98917 100644 --- a/jsroot/types/fundamental/real32trunc/read.mjs +++ b/jsroot/types/fundamental/real32trunc/read.mjs @@ -9,5 +9,7 @@ const fields = [ "DoubleReal32Trunc31", ]; -const [input, output] = process.argv.slice(2); +const [input = "types.fundamental.real32trunc.root", output = "types.fundamental.real32trunc.json"] = + process.argv.slice(2); + read(input, output, fields, floatToHex);