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 3.0.2 to 3.0.3

README.md

62

dist/index.js

@@ -160,9 +160,10 @@ "use strict";

this._parsed = /* @__PURE__ */ new Map();
var _a;
this._headers = responseHeaders;
const headers = this._headers.getAll("set-cookie");
for (const header of headers) {
const parsed = parseSetCookieString(header);
if (parsed) {
const setCookie = ((_a = responseHeaders.getAll) == null ? void 0 : _a.call(responseHeaders, "set-cookie")) ?? responseHeaders.get("set-cookie") ?? [];
const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);
for (const cookieString of cookieStrings) {
const parsed = parseSetCookieString(cookieString);
if (parsed)
this._parsed.set(parsed.name, parsed);
}
}

@@ -217,2 +218,53 @@ }

}
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;
}
// Annotate the CommonJS export names for ESM import in node:

@@ -219,0 +271,0 @@ 0 && (module.exports = {

17

package.json

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

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

@@ -20,10 +20,19 @@ "module": "dist/index.mjs",

"cookies",
"set-cookie"
"edge",
"edge-runtime",
"functions",
"runtime",
"set-cookie",
"standard",
"web"
],
"devDependencies": {
"@edge-runtime/format": "1.1.0",
"@edge-runtime/jest-environment": "2.0.2",
"@edge-runtime/format": "2.0.0",
"@edge-runtime/jest-environment": "2.0.3",
"@types/cookie": "0.5.1",
"tsup": "6"
},
"engines": {
"node": ">=14"
},
"files": [

@@ -30,0 +39,0 @@ "dist"

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