* @param {import('../../types/dispatcher.d.ts').default.DispatchOptions} opts
(opts)
| 12 | * @param {import('../../types/dispatcher.d.ts').default.DispatchOptions} opts |
| 13 | */ |
| 14 | function makeCacheKey (opts) { |
| 15 | if (!opts.origin) { |
| 16 | throw new Error('opts.origin is undefined') |
| 17 | } |
| 18 | |
| 19 | let fullPath = opts.path || '/' |
| 20 | |
| 21 | if (opts.query && !pathHasQueryOrFragment(fullPath)) { |
| 22 | fullPath = serializePathWithQuery(fullPath, opts.query) |
| 23 | } |
| 24 | |
| 25 | return { |
| 26 | origin: opts.origin.toString(), |
| 27 | method: opts.method, |
| 28 | path: fullPath, |
| 29 | headers: opts.headers |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @param {Record<string, string[] | string>} |
no test coverage detected
searching dependent graphs…