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

Function parseMetadata

github-actions/browserstack/set-browserstack-env.js:4532–4550  ·  view source on GitHub ↗
(metadata)

Source from the content-addressed store, hash-verified

4530 }
4531 }
4532 if (compareBase64Mixed(actualValue, expectedValue)) {
4533 return true;
4534 }
4535 }
4536 return false;
4537 }
4538 var parseHashWithOptions = new RegExp("(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?", "i");
4539 function parseMetadata(metadata) {
4540 const result = [];
4541 let empty = true;
4542 for (const token of metadata.split(" ")) {
4543 empty = false;
4544 const parsedToken = parseHashWithOptions.exec(token);
4545 if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) {
4546 continue;
4547 }
4548 const algorithm = parsedToken.groups.algo.toLowerCase();
4549 if (supportedHashes.includes(algorithm)) {
4550 result.push(parsedToken.groups);
4551 }
4552 }
4553 if (empty === true) {

Callers 1

bytesMatchFunction · 0.70

Calls 2

execMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected