mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
[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> = {};
|
let _slots: Record<string, any> = {};
|
||||||
if (Object.keys(slotted).length > 0) {
|
if (Object.keys(slotted).length > 0) {
|
||||||
// hydratable
|
// hydratable
|
||||||
if (client !== "only") {
|
if (client !== 'only') {
|
||||||
const iterator = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, (node) => {
|
const iterator = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, (node) => {
|
||||||
if (node === element) return NodeFilter.FILTER_SKIP
|
if (node === element) return NodeFilter.FILTER_SKIP;
|
||||||
if (node.nodeName === "ASTRO-SLOT") return NodeFilter.FILTER_ACCEPT;
|
if (node.nodeName === 'ASTRO-SLOT') return NodeFilter.FILTER_ACCEPT;
|
||||||
if (node.nodeName === "ASTRO-ISLAND") return NodeFilter.FILTER_REJECT;
|
if (node.nodeName === 'ASTRO-ISLAND') return NodeFilter.FILTER_REJECT;
|
||||||
return NodeFilter.FILTER_SKIP;
|
return NodeFilter.FILTER_SKIP;
|
||||||
});
|
});
|
||||||
while(slot = iterator.nextNode() as HTMLElement | null)
|
while ((slot = iterator.nextNode() as HTMLElement | null))
|
||||||
_slots[slot.getAttribute("name") || "default"] = slot;
|
_slots[slot.getAttribute('name') || 'default'] = slot;
|
||||||
}
|
}
|
||||||
for (const [key, value] of Object.entries(slotted)) {
|
for (const [key, value] of Object.entries(slotted)) {
|
||||||
if (_slots[key]) continue;
|
if (_slots[key]) continue;
|
||||||
|
|
Loading…
Reference in a new issue