From 8cd9ac94e96bc9af1cf4abc63ee3f2a7a451daa7 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sun, 21 Jun 2026 02:04:30 +0200 Subject: [PATCH] style: format static/dedupe.ts --- static/dedupe.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/static/dedupe.ts b/static/dedupe.ts index 7f00fe8..576236b 100644 --- a/static/dedupe.ts +++ b/static/dedupe.ts @@ -19,7 +19,7 @@ export const dedupeByID = (items: T[], idForItem: (item: T) => string | undef export const dedupeWithin = (root: ParentNode): void => { const elements = root.querySelectorAll(":scope > [data-id]"); - const uniqueElements = new Set(dedupeByID(Array.from(elements), (item) => item.dataset.id)); + const uniqueElements = new Set(dedupeByID([...elements], (item) => item.dataset.id)); elements.forEach((item) => { if (!uniqueElements.has(item)) { @@ -69,6 +69,12 @@ const dedupeSwapTarget = (target: EventTarget | null): void => { }); }; -onReady(() => dedupe()); -window.addEventListener("load", () => dedupe()); -onHtmxLoad((root) => dedupeSwapTarget(root)); +onReady(() => { + dedupe(); +}); +window.addEventListener("load", () => { + dedupe(); +}); +onHtmxLoad((root) => { + dedupeSwapTarget(root); +});