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

Function stringify

github-actions/browserstack/set-browserstack-env.js:16573–16620  ·  view source on GitHub ↗
(cookie)

Source from the content-addressed store, hash-verified

16571 code > 126 || // exclude DEL and non-ascii
16572 code === 59) {
16573 throw new Error("Invalid cookie path");
16574 }
16575 }
16576 }
16577 function isLetterOrDigit(code) {
16578 return code >= 48 && code <= 57 || // 0-9
16579 code >= 65 && code <= 90 || // A-Z
16580 code >= 97 && code <= 122;
16581 }
16582 function validateCookieDomain(domain) {
16583 if (domain === " ") {
16584 return;
16585 }
16586 if (domain.length > 255) {
16587 throw new Error("Invalid cookie domain");
16588 }
16589 let labelLength = 0;
16590 for (let i = 0; i < domain.length; ++i) {
16591 const code = domain.charCodeAt(i);
16592 if (code === 46) {
16593 if (labelLength === 0) {
16594 throw new Error("Invalid cookie domain");
16595 }
16596 if (domain.charCodeAt(i - 1) === 45) {
16597 throw new Error("Invalid cookie domain");
16598 }
16599 labelLength = 0;
16600 continue;
16601 }
16602 if (labelLength === 0 && !isLetterOrDigit(code)) {
16603 throw new Error("Invalid cookie domain");
16604 }
16605 if (!isLetterOrDigit(code) && code !== 45) {
16606 throw new Error("Invalid cookie domain");
16607 }
16608 if (++labelLength > 63) {
16609 throw new Error("Invalid cookie domain");
16610 }
16611 }
16612 if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 45) {
16613 throw new Error("Invalid cookie domain");
16614 }
16615 }
16616 var IMFDays = [
16617 "Sun",
16618 "Mon",
16619 "Tue",
16620 "Wed",
16621 "Thu",
16622 "Fri",
16623 "Sat"

Callers 2

buildURLFunction · 0.70
setCookieFunction · 0.70

Calls 8

validateCookieNameFunction · 0.70
validateCookieValueFunction · 0.70
validateCookieMaxAgeFunction · 0.70
validateCookieDomainFunction · 0.70
validateCookiePathFunction · 0.70
toIMFDateFunction · 0.70
pushMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected