* @param {any} key
(key)
| 258 | * @param {any} key |
| 259 | */ |
| 260 | function assertCacheKey (key) { |
| 261 | if (typeof key !== 'object') { |
| 262 | throw new TypeError(`expected key to be object, got ${typeof key}`) |
| 263 | } |
| 264 | |
| 265 | for (const property of ['origin', 'method', 'path']) { |
| 266 | if (typeof key[property] !== 'string') { |
| 267 | throw new TypeError(`expected key.${property} to be string, got ${typeof key[property]}`) |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | if (key.headers !== undefined && typeof key.headers !== 'object') { |
| 272 | throw new TypeError(`expected headers to be object, got ${typeof key}`) |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * @param {any} value |
no outgoing calls
no test coverage detected