import type { Cacheable, ICache } from './shared' export class InMemoryCache { public enclosedCache: ICache = (function () { const cache: Record = {} return { set(key: string, entry: T) { cache[key] = entry }, get(key: string) { const cacheEntry = cache[key] as T if (!cacheEntry) return return cacheEntry }, remove(key: string) { delete cache[key] }, allKeys(): string[] { return Object.keys(cache) }, } })() }