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

Method put

github-actions/browserstack/set-browserstack-env.js:15948–16030  ·  view source on GitHub ↗
(_0, _1)

Source from the content-addressed store, hash-verified

15946 fetchControllers.push(fetching({
15947 request: r,
15948 processResponse(response) {
15949 if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) {
15950 responsePromise.reject(webidl.errors.exception({
15951 header: "Cache.addAll",
15952 message: "Received an invalid status code or the request failed."
15953 }));
15954 } else if (response.headersList.contains("vary")) {
15955 const fieldValues = getFieldValues(response.headersList.get("vary"));
15956 for (const fieldValue of fieldValues) {
15957 if (fieldValue === "*") {
15958 responsePromise.reject(webidl.errors.exception({
15959 header: "Cache.addAll",
15960 message: "invalid vary field value"
15961 }));
15962 for (const controller of fetchControllers) {
15963 controller.abort();
15964 }
15965 return;
15966 }
15967 }
15968 }
15969 },
15970 processResponseEndOfBody(response) {
15971 if (response.aborted) {
15972 responsePromise.reject(new DOMException("aborted", "AbortError"));
15973 return;
15974 }
15975 responsePromise.resolve(response);
15976 }
15977 }));
15978 responsePromises.push(responsePromise.promise);
15979 }
15980 const p = Promise.all(responsePromises);
15981 const responses = yield p;
15982 const operations = [];
15983 let index = 0;
15984 for (const response of responses) {
15985 const operation = {
15986 type: "put",
15987 // 7.3.2
15988 request: requestList[index],
15989 // 7.3.3
15990 response
15991 // 7.3.4
15992 };
15993 operations.push(operation);
15994 index++;
15995 }
15996 const cacheJobPromise = createDeferredPromise();
15997 let errorData = null;
15998 try {
15999 __privateMethod(this, _batchCacheOperations, batchCacheOperations_fn).call(this, operations);
16000 } catch (e) {
16001 errorData = e;
16002 }
16003 queueMicrotask(() => {
16004 if (errorData === null) {
16005 cacheJobPromise.resolve(void 0);

Callers

nothing calls this directly

Calls 11

__asyncFunction · 0.70
urlIsHttpHttpsSchemeFunction · 0.70
getFieldValuesFunction · 0.70
isDisturbedFunction · 0.70
cloneResponseFunction · 0.70
createDeferredPromiseFunction · 0.70
readAllBytesFunction · 0.70
__privateMethodFunction · 0.70
containsMethod · 0.45
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected