refactor(plugin-sdk): unify channel dedupe primitives

This commit is contained in:
Peter Steinberger
2026-02-22 10:46:00 +01:00
parent edaa5ef7a5
commit 59807efa31
10 changed files with 339 additions and 70 deletions

View File

@@ -227,5 +227,13 @@ describe("infra store", () => {
expect(cache.check("c", 200)).toBe(false);
expect(cache.size()).toBe(2);
});
it("supports non-mutating existence checks via peek()", () => {
const cache = createDedupeCache({ ttlMs: 1000, maxSize: 10 });
expect(cache.peek("a", 100)).toBe(false);
expect(cache.check("a", 100)).toBe(false);
expect(cache.peek("a", 200)).toBe(true);
expect(cache.peek("a", 1201)).toBe(false);
});
});
});