New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@edge-runtime/cookies

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edge-runtime/cookies - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

55

dist/index.js

@@ -114,2 +114,53 @@ "use strict";

}
function splitCookiesString(cookiesString) {
if (!cookiesString)
return [];
var cookiesStrings = [];
var pos = 0;
var start;
var ch;
var lastComma;
var nextStart;
var cookiesSeparatorFound;
function skipWhitespace() {
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
pos += 1;
}
return pos < cookiesString.length;
}
function notSpecialChar() {
ch = cookiesString.charAt(pos);
return ch !== "=" && ch !== ";" && ch !== ",";
}
while (pos < cookiesString.length) {
start = pos;
cookiesSeparatorFound = false;
while (skipWhitespace()) {
ch = cookiesString.charAt(pos);
if (ch === ",") {
lastComma = pos;
pos += 1;
skipWhitespace();
nextStart = pos;
while (pos < cookiesString.length && notSpecialChar()) {
pos += 1;
}
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
cookiesSeparatorFound = true;
pos = nextStart;
cookiesStrings.push(cookiesString.substring(start, lastComma));
start = pos;
} else {
pos = lastComma + 1;
}
} else {
pos += 1;
}
}
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
}
}
return cookiesStrings;
}

@@ -200,4 +251,6 @@ // src/request-cookies.ts

this._parsed = /* @__PURE__ */ new Map();
var _a, _b, _c;
this._headers = responseHeaders;
const cookieStrings = responseHeaders.getSetCookie();
const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get("set-cookie")) != null ? _c : [];
const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);
for (const cookieString of cookieStrings) {

@@ -204,0 +257,0 @@ const parsed = parseSetCookie(cookieString);

4

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://edge-runtime.vercel.app/packages/cookies",
"version": "4.0.1",
"version": "4.0.2",
"main": "dist/index.js",

@@ -32,3 +32,3 @@ "module": "dist/index.mjs",

"@edge-runtime/format": "2.2.0",
"@edge-runtime/jest-environment": "2.3.4"
"@edge-runtime/jest-environment": "2.3.5"
},

@@ -35,0 +35,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc