( request: HttpRequest<any>, mappedRequestUrl: string, )
| 382 | } |
| 383 | |
| 384 | function makeCacheKey( |
| 385 | request: HttpRequest<any>, |
| 386 | mappedRequestUrl: string, |
| 387 | ): StateKey<TransferHttpResponse> { |
| 388 | const {params, method, responseType} = request; |
| 389 | const encodedParams = sortAndConcatParams(params); |
| 390 | |
| 391 | let serializedBody = request.serializeBody(); |
| 392 | if (serializedBody instanceof URLSearchParams) { |
| 393 | serializedBody = sortAndConcatParams(serializedBody); |
| 394 | } else if (typeof serializedBody !== 'string') { |
| 395 | serializedBody = ''; |
| 396 | } |
| 397 | |
| 398 | const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|'); |
| 399 | const hash = generateHash(key); |
| 400 | |
| 401 | return makeStateKey(hash); |
| 402 | } |
| 403 | |
| 404 | function toBase64(buffer: unknown): string { |
| 405 | //TODO: replace with when is Baseline widely available |
no test coverage detected
searching dependent graphs…