MCPcopy
hub / github.com/nodejs/undici / makeCacheStore

Function makeCacheStore

test/cache-interceptor/cache-tests-worker.mjs:76–92  ·  view source on GitHub ↗

* @param {import('./cache-tests.mjs').TestEnvironment['cacheStore']} type * @returns {Promise }

(type)

Source from the content-addressed store, hash-verified

74 * @returns {Promise<import('../../types/cache-interceptor').default.CacheStore>}
75 */
76async function makeCacheStore (type) {
77 const stores = {
78 MemoryCacheStore
79 }
80
81 if (runtimeFeatures.has('sqlite')) {
82 const { default: SqliteCacheStore } = await import('../../lib/cache/sqlite-cache-store.js')
83 stores.SqliteCacheStore = SqliteCacheStore
84 }
85
86 const Store = stores[type]
87 if (!Store) {
88 throw new TypeError(`unknown cache store: ${type}`)
89 }
90
91 return new Store()
92}
93
94/**
95 * @param {string} baseUrl

Callers 1

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…