import { createCache, CreateCacheOptions } from "./createCache"; import { Cache } from "../types"; const key = Symbol.for("createSingleEntryCache").toString(); export function createSingleEntryCache, Value>( options: Omit, "getKey"> ): Cache { if (options.hasOwnProperty("getKey")) { throw Error("createSingleEntryCache does not support a getKey option"); } return createCache({ getKey: () => key, ...options, }); }