Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/cookie

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/cookie - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

6

CHANGELOG.md
# @tinyhttp/cookie
## 0.5.3
### Patch Changes
- bump
## 0.5.2

@@ -4,0 +10,0 @@

21

dist/index.js

@@ -34,5 +34,4 @@ const pairSplitRegExp = /; */;

// skip things that don't look like key=value
if (eqIdx < 0) {
if (eqIdx < 0)
continue;
}
const key = pair.substr(0, eqIdx).trim();

@@ -52,21 +51,17 @@ let val = pair.substr(++eqIdx, pair.length).trim();

opt.encode = encodeURIComponent;
if (!fieldContentRegExp.test(name)) {
if (!fieldContentRegExp.test(name))
throw new TypeError('argument name is invalid');
}
const value = opt.encode(val);
if (value && !fieldContentRegExp.test(value)) {
if (value && !fieldContentRegExp.test(value))
throw new TypeError('argument val is invalid');
}
let str = name + '=' + value;
if (null != opt.maxAge) {
const maxAge = opt.maxAge - 0;
if (isNaN(maxAge) || !isFinite(maxAge)) {
if (isNaN(maxAge) || !isFinite(maxAge))
throw new TypeError('option maxAge is invalid');
}
str += '; Max-Age=' + Math.floor(maxAge);
}
if (opt.domain) {
if (!fieldContentRegExp.test(opt.domain)) {
if (!fieldContentRegExp.test(opt.domain))
throw new TypeError('option domain is invalid');
}
str += '; Domain=' + opt.domain;

@@ -86,8 +81,6 @@ }

}
if (opt.httpOnly) {
if (opt.httpOnly)
str += '; HttpOnly';
}
if (opt.secure) {
if (opt.secure)
str += '; Secure';
}
if (opt.sameSite) {

@@ -94,0 +87,0 @@ const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;

{
"name": "@tinyhttp/cookie",
"version": "0.5.2",
"version": "0.5.3",
"type": "module",

@@ -5,0 +5,0 @@ "description": "HTTP cookie parser and serializer for Node.js",

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