Fix: collect() now accepts both CSS selector strings and NodeLists

This commit is contained in:
iorebuild
2026-06-07 17:46:02 +08:00
parent 2a866a2ad4
commit 63dc02e485
+2 -1
View File
@@ -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) {