//#region src/memory.ts
/**
* Isolate-local in-memory backend for dev, test, and fallback use only.
* Unbounded growth (no LRU/size cap in v1) and evaporates on restart — not a
* production cache.
*/
function createMemoryBackend() {
	const store = /* @__PURE__ */ new Map();
	return {
		async get(key) {
			const entry = store.get(key);
			if (!entry) return void 0;
			if (entry.expiresAt !== void 0 && entry.expiresAt <= Date.now()) {
				store.delete(key);
				return;
			}
			return entry.value;
		},
		async set(key, value, ttlSeconds) {
			const expiresAt = ttlSeconds !== void 0 ? Date.now() + ttlSeconds * 1e3 : void 0;
			store.set(key, {
				value,
				expiresAt
			});
		},
		async del(key) {
			store.delete(key);
		}
	};
}
//#endregion
export { createMemoryBackend };
