MCPcopy Create free account
hub / github.com/angular/dev-infra / makeResponse

Function makeResponse

github-actions/browserstack/set-browserstack-env.js:12863–12878  ·  view source on GitHub ↗
(init)

Source from the content-addressed store, hash-verified

12861 // Creates network error Response.
12862 static error() {
12863 const responseObject = fromInnerResponse(makeNetworkError(), "immutable");
12864 return responseObject;
12865 }
12866 // https://fetch.spec.whatwg.org/#dom-response-json
12867 static json(data, init = {}) {
12868 webidl.argumentLengthCheck(arguments, 1, "Response.json");
12869 if (init !== null) {
12870 init = webidl.converters.ResponseInit(init);
12871 }
12872 const bytes = textEncoder.encode(
12873 serializeJavascriptValueToJSONString(data)
12874 );
12875 const body = extractBody(bytes);
12876 const responseObject = fromInnerResponse(makeResponse({}), "response");
12877 initializeResponse(responseObject, init, { body: body[0], type: "application/json" });
12878 return responseObject;
12879 }
12880 // Creates a redirect Response that redirects to url with status status.
12881 static redirect(url, status = 302) {

Callers 7

jsonMethod · 0.70
redirectMethod · 0.70
constructorMethod · 0.70
cloneResponseFunction · 0.70
makeNetworkErrorFunction · 0.70
schemeFetchFunction · 0.70
httpNetworkFetchFunction · 0.70

Calls 2

__spreadPropsFunction · 0.70
__spreadValuesFunction · 0.70

Tested by

no test coverage detected