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

Function URLSerializer

github-actions/browserstack/set-browserstack-env.js:3491–3502  ·  view source on GitHub ↗
(url, excludeFragment = false)

Source from the content-addressed store, hash-verified

3489 if (mimeType.startsWith(";")) {
3490 mimeType = "text/plain" + mimeType;
3491 }
3492 let mimeTypeRecord = parseMIMEType(mimeType);
3493 if (mimeTypeRecord === "failure") {
3494 mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII");
3495 }
3496 return { mimeType: mimeTypeRecord, body };
3497 }
3498 function URLSerializer(url, excludeFragment = false) {
3499 if (!excludeFragment) {
3500 return url.href;
3501 }
3502 const href = url.href;
3503 const hashLength = url.hash.length;
3504 const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength);
3505 if (!hashLength && href.endsWith("#")) {

Callers 6

dataURLProcessorFunction · 0.70
redirectMethod · 0.70
urlMethod · 0.70
urlMethod · 0.70
urlEqualsFunction · 0.70
urlMethod · 0.70

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected