From 128a5a9b3ace216aaf9093234e9b631fad5a3511 Mon Sep 17 00:00:00 2001 From: Jad Dayoub Date: Fri, 7 Aug 2026 13:43:39 +0200 Subject: [PATCH 1/4] Add JSROOT test for types/string --- jsroot/types/string/read.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 jsroot/types/string/read.mjs diff --git a/jsroot/types/string/read.mjs b/jsroot/types/string/read.mjs new file mode 100644 index 0000000..f68df06 --- /dev/null +++ b/jsroot/types/string/read.mjs @@ -0,0 +1,13 @@ +import { read } from "../../jsroot_reader.mjs"; + +function getUtf8decoding(s) { + const bytes = Uint8Array.from(s, (c) => c.charCodeAt(0)); + return new TextDecoder("utf-8").decode(bytes); +} + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [input = "types.string.root", output = "types.string.json"] = + process.argv.slice(2); + +read(input, output, fields, getUtf8decoding); From 57773de4b35f59126c3b9eb4710b60927ef4ba05 Mon Sep 17 00:00:00 2001 From: Jad Dayoub Date: Fri, 7 Aug 2026 13:43:58 +0200 Subject: [PATCH 2/4] Add JSROOT test for types/variant --- jsroot/types/variant/read.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 jsroot/types/variant/read.mjs diff --git a/jsroot/types/variant/read.mjs b/jsroot/types/variant/read.mjs new file mode 100644 index 0000000..d659129 --- /dev/null +++ b/jsroot/types/variant/read.mjs @@ -0,0 +1,8 @@ +import { read } from "../../jsroot_reader.mjs"; + +const fields = ["f", "Vector"]; + +const [input = "types.variant.root", output = "types.variant.json"] = + process.argv.slice(2); + +read(input, output, fields); From f243f4bbe02be6f624b197a71ab17947fdd216ee Mon Sep 17 00:00:00 2001 From: Jad Dayoub Date: Fri, 7 Aug 2026 13:44:08 +0200 Subject: [PATCH 3/4] Add JSROOT test for types/vector/fundamental --- jsroot/types/vector/README.md | 3 +++ jsroot/types/vector/fundamental/read.mjs | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 jsroot/types/vector/README.md create mode 100644 jsroot/types/vector/fundamental/read.mjs diff --git a/jsroot/types/vector/README.md b/jsroot/types/vector/README.md new file mode 100644 index 0000000..26160b2 --- /dev/null +++ b/jsroot/types/vector/README.md @@ -0,0 +1,3 @@ +# `std::vector` + + * [`fundamental`](fundamental): `std::vector` diff --git a/jsroot/types/vector/fundamental/read.mjs b/jsroot/types/vector/fundamental/read.mjs new file mode 100644 index 0000000..8b1b27c --- /dev/null +++ b/jsroot/types/vector/fundamental/read.mjs @@ -0,0 +1,10 @@ +import { read } from "../../../jsroot_reader.mjs"; + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [ + input = "types.vector.fundamental.root", + output = "types.vector.fundamental.json", +] = process.argv.slice(2); + +read(input, output, fields); From ef8d421085c839ab398c31f6d96e2557d560c9aa Mon Sep 17 00:00:00 2001 From: Jad Dayoub Date: Fri, 7 Aug 2026 13:46:18 +0200 Subject: [PATCH 4/4] Add JSROOT test for types/vector/nested --- jsroot/types/vector/README.md | 1 + jsroot/types/vector/nested/read.mjs | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 jsroot/types/vector/nested/read.mjs diff --git a/jsroot/types/vector/README.md b/jsroot/types/vector/README.md index 26160b2..cddafec 100644 --- a/jsroot/types/vector/README.md +++ b/jsroot/types/vector/README.md @@ -1,3 +1,4 @@ # `std::vector` * [`fundamental`](fundamental): `std::vector` + * [`nested`](nested): `std::vector>` diff --git a/jsroot/types/vector/nested/read.mjs b/jsroot/types/vector/nested/read.mjs new file mode 100644 index 0000000..2658ddc --- /dev/null +++ b/jsroot/types/vector/nested/read.mjs @@ -0,0 +1,10 @@ +import { read } from "../../../jsroot_reader.mjs"; + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [ + input = "types.vector.nested.root", + output = "types.vector.nested.json", +] = process.argv.slice(2); + +read(input, output, fields);