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

Function matchHeaders

github-actions/saucelabs/set-saucelabs-env.js:10930–10950  ·  view source on GitHub ↗
(mockDispatch2, headers)

Source from the content-addressed store, hash-verified

10928 var {
10929 types: {
10930 isPromise
10931 }
10932 } = __require("util");
10933 function matchValue(match, value) {
10934 if (typeof match === "string") {
10935 return match === value;
10936 }
10937 if (match instanceof RegExp) {
10938 return match.test(value);
10939 }
10940 if (typeof match === "function") {
10941 return match(value) === true;
10942 }
10943 return false;
10944 }
10945 function lowerCaseEntries(headers) {
10946 return Object.fromEntries(
10947 Object.entries(headers).map(([headerName, headerValue]) => {
10948 return [headerName.toLocaleLowerCase(), headerValue];
10949 })
10950 );
10951 }
10952 function getHeaderByName(headers, key) {
10953 if (Array.isArray(headers)) {

Callers 2

matchKeyFunction · 0.70
getMockDispatchFunction · 0.70

Calls 6

buildHeadersFromArrayFunction · 0.70
lowerCaseEntriesFunction · 0.70
getHeaderByNameFunction · 0.70
matchValueFunction · 0.70
headersMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected