@skrillex1224/playwright-toolkit 2.1.184 → 2.1.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -990,6 +990,22 @@ var normalizeAuth = (value) => {
990
990
  return acc;
991
991
  }, {});
992
992
  };
993
+ var normalizeCookieSameSite = (value) => {
994
+ const raw = String(value || "").trim().toLowerCase();
995
+ if (!raw) return "";
996
+ switch (raw) {
997
+ case "strict":
998
+ return "Strict";
999
+ case "lax":
1000
+ return "Lax";
1001
+ case "none":
1002
+ case "no_restriction":
1003
+ return "None";
1004
+ case "unspecified":
1005
+ default:
1006
+ return "";
1007
+ }
1008
+ };
993
1009
  var normalizeCookies = (value) => {
994
1010
  if (!Array.isArray(value)) return [];
995
1011
  return value.map((item) => {
@@ -999,14 +1015,14 @@ var normalizeCookies = (value) => {
999
1015
  if (!name || !cookieValue || cookieValue === "<nil>") return null;
1000
1016
  const domain = String(raw.domain || "").trim();
1001
1017
  const path2 = String(raw.path || "").trim() || "/";
1002
- const sameSiteRaw = String(raw.sameSite || "").trim();
1018
+ const sameSite = normalizeCookieSameSite(raw.sameSite);
1003
1019
  return {
1004
1020
  ...raw,
1005
1021
  name,
1006
1022
  value: cookieValue,
1007
1023
  domain,
1008
1024
  path: path2,
1009
- ...sameSiteRaw ? { sameSite: sameSiteRaw } : {}
1025
+ ...sameSite ? { sameSite } : {}
1010
1026
  };
1011
1027
  }).filter(Boolean);
1012
1028
  };