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

kequapp

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kequapp - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

21

dist/router/create-cookies.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function createCookies(req, res) {
const result = {};
const values = {};
function get(key) {
var _a, _b;
if (Object.prototype.hasOwnProperty.call(values, key))
return values[key];
const cookies = (_b = (_a = req.headers.cookie) === null || _a === void 0 ? void 0 : _a.split('; ')) !== null && _b !== void 0 ? _b : [];
const cookie = cookies.find(cookie => cookie.startsWith(`${key}=`));
return cookie === null || cookie === void 0 ? void 0 : cookie.split('=')[1];
return cookie === null || cookie === void 0 ? void 0 : cookie.split('=', 2)[1];
}

@@ -13,9 +17,9 @@ function set(key, value, options) {

if (options) {
if (options.expires)
if (options.expires !== undefined)
attrs.push(`Expires=${formatExpires(options.expires)}`);
if (options.maxAge)
if (options.maxAge !== undefined)
attrs.push(`Max-Age=${options.maxAge}`);
if (options.domain)
if (options.domain !== undefined)
attrs.push(`Domain=${options.domain}`);
if (options.path)
if (options.path !== undefined)
attrs.push(`Path=${options.path}`);

@@ -28,9 +32,12 @@ if (options.secure)

attrs.push('Partitioned');
if (options.sameSite)
if (options.sameSite !== undefined)
attrs.push(`SameSite=${options.sameSite}`);
}
res.setHeader('Set-Cookie', attrs.join('; '));
result[key] = attrs.join('; ');
values[key] = value;
res.setHeader('Set-Cookie', Object.values(result));
}
function remove(key) {
set(key, '', { maxAge: 0 });
values[key] = undefined;
}

@@ -37,0 +44,0 @@ return { get, set, remove };

{
"name": "kequapp",
"version": "0.5.1",
"version": "0.5.2",
"description": "Non-intrusive Node JavaScript web app framework",

@@ -5,0 +5,0 @@ "main": "dist/main.js",

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