[ci] format
This commit is contained in:
parent
a525d5db17
commit
8a08cb8d2a
1 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
return NodeFilter.FILTER_SKIP;
|
||||
});
|
||||
while(slot = iterator.nextNode() as HTMLElement | null)
|
||||
_slots[slot.getAttribute("name") || "default"] = slot;
|
||||
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;
|
||||
}
|
||||
for (const [key, value] of Object.entries(slotted)) {
|
||||
if (_slots[key]) continue;
|
||||
|
|
Loading…
Reference in a new issue