xhr-BfNfxNDv.mjs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @license Angular v19.2.13
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. function parseCookieValue(cookieStr, name) {
  7. name = encodeURIComponent(name);
  8. for (const cookie of cookieStr.split(';')) {
  9. const eqIndex = cookie.indexOf('=');
  10. const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
  11. if (cookieName.trim() === name) {
  12. return decodeURIComponent(cookieValue);
  13. }
  14. }
  15. return null;
  16. }
  17. const PLATFORM_BROWSER_ID = 'browser';
  18. const PLATFORM_SERVER_ID = 'server';
  19. /**
  20. * Returns whether a platform id represents a browser platform.
  21. * @publicApi
  22. */
  23. function isPlatformBrowser(platformId) {
  24. return platformId === PLATFORM_BROWSER_ID;
  25. }
  26. /**
  27. * Returns whether a platform id represents a server platform.
  28. * @publicApi
  29. */
  30. function isPlatformServer(platformId) {
  31. return platformId === PLATFORM_SERVER_ID;
  32. }
  33. /**
  34. * A wrapper around the `XMLHttpRequest` constructor.
  35. *
  36. * @publicApi
  37. */
  38. class XhrFactory {
  39. }
  40. export { PLATFORM_BROWSER_ID, PLATFORM_SERVER_ID, XhrFactory, isPlatformBrowser, isPlatformServer, parseCookieValue };
  41. //# sourceMappingURL=xhr-BfNfxNDv.mjs.map