@edge-runtime/cookies
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -83,3 +83,3 @@ // Type definitions for cookie 0.5 | ||
*/ | ||
priority?: 'low' | 'medium' | 'high' | undefined; | ||
priority?: "low" | "medium" | "high" | undefined; | ||
/** | ||
@@ -102,3 +102,3 @@ * Specifies the boolean or string to be the value for the {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|`SameSite` `Set-Cookie` attribute}. | ||
*/ | ||
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined; | ||
sameSite?: true | false | "lax" | "strict" | "none" | undefined; | ||
/** | ||
@@ -105,0 +105,0 @@ * Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.5|`Secure` `Set-Cookie` attribute}. When truthy, the |
@@ -235,9 +235,11 @@ "use strict"; | ||
this._parsed = /* @__PURE__ */ new Map(); | ||
var _a, _b, _c; | ||
var _a, _b; | ||
this._headers = responseHeaders; | ||
const setCookie = ( | ||
// @ts-expect-error See https://github.com/whatwg/fetch/issues/973 | ||
(_c = (_b = (_a = responseHeaders.getAll) == null ? void 0 : _a.call(responseHeaders, "set-cookie")) != null ? _b : responseHeaders.get("set-cookie")) != null ? _c : [] | ||
const setCookie = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders); | ||
(_b = responseHeaders.get("set-cookie")) != null ? _b : []; | ||
const cookieStrings = Array.isArray(setCookie) ? setCookie : ( | ||
// TODO: remove splitCookiesString when `getSetCookie` adoption is high enough in Node.js | ||
// https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie#browser_compatibility | ||
splitCookiesString(setCookie) | ||
); | ||
const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie); | ||
for (const cookieString of cookieStrings) { | ||
@@ -244,0 +246,0 @@ const parsed = parseSetCookie(cookieString); |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://edge-runtime.vercel.app/packages/cookies", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"main": "dist/index.js", | ||
@@ -29,6 +29,6 @@ "module": "dist/index.mjs", | ||
"devDependencies": { | ||
"@types/cookie": "0.5.1", | ||
"@types/cookie": "0.5.2", | ||
"tsup": "7", | ||
"@edge-runtime/format": "2.2.0", | ||
"@edge-runtime/jest-environment": "2.3.0" | ||
"@edge-runtime/jest-environment": "2.3.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
47612
808
1