MCPcopy Create free account
hub / github.com/nodejs/node / finalizeResponse

Function finalizeResponse

deps/undici/src/lib/web/fetch/index.js:1010–1020  ·  view source on GitHub ↗
(fetchParams, response)

Source from the content-addressed store, hash-verified

1008
1009// https://fetch.spec.whatwg.org/#finalize-response
1010function finalizeResponse (fetchParams, response) {
1011 // 1. Set fetchParams’s request’s done flag.
1012 fetchParams.request.done = true
1013
1014 // 2, If fetchParams’s process response done is not null, then queue a fetch
1015 // task to run fetchParams’s process response done given response, with
1016 // fetchParams’s task destination.
1017 if (fetchParams.processResponseDone != null) {
1018 queueMicrotask(() => fetchParams.processResponseDone(response))
1019 }
1020}
1021
1022// https://fetch.spec.whatwg.org/#fetch-finale
1023function fetchFinale (fetchParams, response) {

Callers 1

httpNetworkFetchFunction · 0.70

Calls 1

queueMicrotaskFunction · 0.85

Tested by

no test coverage detected