diff --git a/internal/web/static/app.js b/internal/web/static/app.js index 1e1f134..c175f00 100644 --- a/internal/web/static/app.js +++ b/internal/web/static/app.js @@ -41,7 +41,9 @@ function blankTransfer() { // --- plumbing ------------------------------------------------------------- // h builds an element. Text always goes in as a text node, never as HTML, -// since descriptions come straight off bank statements. +// since descriptions come straight off bank statements. Children flatten all +// the way down: a map that yields a group of rows — the report's transfers +// and their fee — would otherwise be stringified into the page. function h(tag, attrs, ...children) { const el = document.createElement(tag); for (const [k, v] of Object.entries(attrs || {})) { @@ -51,7 +53,7 @@ function h(tag, attrs, ...children) { else if (k === 'value') el.value = v; else el.setAttribute(k, v === true ? '' : v); } - for (const c of children.flat()) { + for (const c of children.flat(Infinity)) { if (c === null || c === undefined || c === false) continue; el.append(c instanceof Node ? c : document.createTextNode(String(c))); }