MCPcopy
hub / github.com/mswjs/msw / normalizeResponseInit

Function normalizeResponseInit

src/core/utils/HttpResponse/decorators.ts:14–27  ·  view source on GitHub ↗
(
  init: HttpResponseInit = {},
)

Source from the content-addressed store, hash-verified

12}
13
14export function normalizeResponseInit(
15 init: HttpResponseInit = {},
16): HttpResponseDecoratedInit {
17 const status = init?.status || 200
18 const statusText = init?.statusText || message[status] || ''
19 const headers = new Headers(init?.headers)
20
21 return {
22 ...init,
23 headers,
24 status,
25 statusText,
26 }
27}
28
29export function decorateResponse(
30 response: Response,

Callers 7

constructorMethod · 0.90
textMethod · 0.90
jsonMethod · 0.90
xmlMethod · 0.90
htmlMethod · 0.90
arrayBufferMethod · 0.90
formDataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…