Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminrobinet committed Nov 13, 2024
1 parent 270d284 commit 772964c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/mergeHeadContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ export default function mergeHeadContents(
.forEach(({ el }) => currentHead.removeChild(el));

// Insert tag *after* previous version of itself to preserve JS variable scope and CSS cascade
const newAddTags = addTags
.filter(({ el }) => shouldManageTag(el))
.map((tag) => {
let newEl = tag.el.cloneNode(true) as Element;
currentHead.insertBefore(newEl, currentHead.children[(tag.index || 0) + 1] || null);

return { ...tag, el: newEl };
});
const newAddTags = addTags
.filter(({ el }) => shouldManageTag(el))
.map((tag) => {
let newEl = tag.el.cloneNode(true) as Element;
currentHead.insertBefore(newEl, currentHead.children[(tag.index || 0) + 1] || null);

return { ...tag, el: newEl };
});

return {
removed: removeTags.map(({ el }) => el),
Expand Down

0 comments on commit 772964c

Please sign in to comment.