release: WRNexusJS 0.6.0
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export function collectRefs(root: ParentNode): Record<string, Element> {
|
||||
const refs: Record<string, Element> = {};
|
||||
if (root instanceof Element && root.hasAttribute("data-ref"))
|
||||
refs[root.getAttribute("data-ref")!] = root;
|
||||
root.querySelectorAll("[data-ref]").forEach((element) => {
|
||||
const name = element.getAttribute("data-ref");
|
||||
if (name) refs[name] = element;
|
||||
});
|
||||
return refs;
|
||||
}
|
||||
Reference in New Issue
Block a user