* @param {unknown} store * @returns {asserts store is import('../../types/cache-interceptor.d.ts').default.CacheStore}
(store, name = 'CacheStore')
| 342 | * @returns {asserts store is import('../../types/cache-interceptor.d.ts').default.CacheStore} |
| 343 | */ |
| 344 | function assertCacheStore (store, name = 'CacheStore') { |
| 345 | if (typeof store !== 'object' || store === null) { |
| 346 | throw new TypeError(`expected type of ${name} to be a CacheStore, got ${store === null ? 'null' : typeof store}`) |
| 347 | } |
| 348 | |
| 349 | for (const fn of ['get', 'createWriteStream', 'delete']) { |
| 350 | if (typeof store[fn] !== 'function') { |
| 351 | throw new TypeError(`${name} needs to have a \`${fn}()\` function`) |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | /** |
| 356 | * @param {unknown} methods |
| 357 | * @returns {asserts methods is import('../../types/cache-interceptor.d.ts').default.CacheMethods[]} |
no outgoing calls
no test coverage detected
searching dependent graphs…