From 63dc02e485663f56a40c3b06e7422c509f4c268d Mon Sep 17 00:00:00 2001 From: iorebuild Date: Sun, 7 Jun 2026 17:46:02 +0800 Subject: [PATCH] Fix: collect() now accepts both CSS selector strings and NodeLists --- resume/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resume/app.js b/resume/app.js index 9ea697d..cf039cf 100644 --- a/resume/app.js +++ b/resume/app.js @@ -125,7 +125,8 @@ const Resume = (() => { } function collect(sel, fn) { - return Array.from(document.querySelectorAll(sel)).map(el => fn ? fn(el) : (el.innerHTML || '')); + const els = (typeof sel === 'string') ? document.querySelectorAll(sel) : sel; + return Array.from(els).map(el => fn ? fn(el) : (el.innerHTML || '')); } function collectCards(listId) {