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

Function percentDecode

github-actions/browserstack/set-browserstack-env.js:3534–3550  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

3532 assert(dataURL.protocol === "data:");
3533 let input = URLSerializer(dataURL, true);
3534 input = input.slice(5);
3535 const position = { position: 0 };
3536 let mimeType = collectASequenceOfCodePointsFast(
3537 ",",
3538 input,
3539 position
3540 );
3541 const mimeTypeLength = mimeType.length;
3542 mimeType = removeASCIIWhitespace(mimeType, true, true);
3543 if (position.position >= input.length) {
3544 return "failure";
3545 }
3546 position.position++;
3547 const encodedBody = input.slice(mimeTypeLength + 1);
3548 let body = stringPercentDecode(encodedBody);
3549 if (/;(\u0020){0,}base64$/i.test(mimeType)) {
3550 const stringBody = isomorphicDecode(body);
3551 body = forgivingBase64(stringBody);
3552 if (body === "failure") {
3553 return "failure";

Callers 1

stringPercentDecodeFunction · 0.70

Calls 2

isHexCharByteFunction · 0.70
hexByteToNumberFunction · 0.70

Tested by

no test coverage detected