From 8e09dd85f8fd0ae9cb60a291ab714fc75dacba4e Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 27 Sep 2026 16:38:33 +0200 Subject: [PATCH] test: the store contract reads the last match without Array.at (the node tsconfig's lib) --- frontend/src/lib/store.contract.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/store.contract.test.ts b/frontend/src/lib/store.contract.test.ts index 66aa18dc..04e397b4 100644 --- a/frontend/src/lib/store.contract.test.ts +++ b/frontend/src/lib/store.contract.test.ts @@ -15,7 +15,7 @@ describe("a store's use()", () => { for (const m of src.matchAll(/\b\w+\.use\(\)/g)) { const before = src.slice(0, m.index); const owners = [...before.matchAll(/(?:function\s+(\w+)|const\s+(\w+)\s*=\s*\()/g)]; - const owner = owners.at(-1); + const owner = owners[owners.length - 1]; const name = owner?.[1] ?? owner?.[2] ?? ""; if (!name.startsWith("use")) offenders.push(`${f}: ${m[0]} in ${name || "?"}`); }