0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] format

This commit is contained in:
natemoo-re 2023-09-06 22:25:23 +00:00 committed by astrobot-houston
parent a525d5db17
commit 8a08cb8d2a

View file

@ -14,15 +14,15 @@ export default (element: HTMLElement) =>
let _slots: Record<string, any> = {};
if (Object.keys(slotted).length > 0) {
// hydratable
if (client !== "only") {
if (client !== 'only') {
const iterator = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, (node) => {
if (node === element) return NodeFilter.FILTER_SKIP
if (node.nodeName === "ASTRO-SLOT") return NodeFilter.FILTER_ACCEPT;
if (node.nodeName === "ASTRO-ISLAND") return NodeFilter.FILTER_REJECT;
if (node === element) return NodeFilter.FILTER_SKIP;
if (node.nodeName === 'ASTRO-SLOT') return NodeFilter.FILTER_ACCEPT;
if (node.nodeName === 'ASTRO-ISLAND') return NodeFilter.FILTER_REJECT;
return NodeFilter.FILTER_SKIP;
});
while(slot = iterator.nextNode() as HTMLElement | null)
_slots[slot.getAttribute("name") || "default"] = slot;
while ((slot = iterator.nextNode() as HTMLElement | null))
_slots[slot.getAttribute('name') || 'default'] = slot;
}
for (const [key, value] of Object.entries(slotted)) {
if (_slots[key]) continue;