* @param {any} key
(key)
| 298 | * @param {any} key |
| 299 | */ |
| 300 | function assertCacheKey (key) { |
| 301 | if (typeof key !== 'object') { |
| 302 | throw new TypeError(`expected key to be object, got ${typeof key}`) |
| 303 | } |
| 304 | |
| 305 | for (const property of ['origin', 'method', 'path']) { |
| 306 | if (typeof key[property] !== 'string') { |
| 307 | throw new TypeError(`expected key.${property} to be string, got ${typeof key[property]}`) |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | if (key.headers !== undefined && typeof key.headers !== 'object') { |
| 312 | throw new TypeError(`expected headers to be object, got ${typeof key}`) |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * @param {any} value |
no outgoing calls
no test coverage detected