test: the store contract reads the last match without Array.at (the node tsconfig's lib)

This commit is contained in:
2026-09-27 16:38:33 +02:00
parent addb3d1b32
commit 8e09dd85f8
+1 -1
View File
@@ -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 || "?"}`);
}