import { CACHE_TTL_MS } from "./config.js"; const cache = new Map(); export function getCached(key) { const entry = cache.get(key); if (!entry) return null; if (Date.now() > entry.expiresAt) { cache.delete(key); return null; } return entry.value; } export function setCached(key, value, ttlMs = CACHE_TTL_MS) { cache.set(key, { value, expiresAt: Date.now() + ttlMs }); } export function clearCached(key) { cache.delete(key); }