* @param {any} key
(key)
| 68 | * @param {any} key |
| 69 | */ |
| 70 | function assertCacheKey (key) { |
| 71 | if (typeof key !== 'object') { |
| 72 | throw new TypeError(`expected key to be object, got ${typeof key}`) |
| 73 | } |
| 74 | |
| 75 | for (const property of ['origin', 'method', 'path']) { |
| 76 | if (typeof key[property] !== 'string') { |
| 77 | throw new TypeError(`expected key.${property} to be string, got ${typeof key[property]}`) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | if (key.headers !== undefined && typeof key.headers !== 'object') { |
| 82 | throw new TypeError(`expected headers to be object, got ${typeof key}`) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * @param {any} value |
no outgoing calls
no test coverage detected
searching dependent graphs…