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

tough-cookie

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tough-cookie - npm Package Compare versions

Comparing version 5.1.0-rc.0 to 5.1.0

13

dist/cookie/canonicalDomain.js

@@ -5,4 +5,11 @@ "use strict";

const constants_1 = require("./constants");
const node_url_1 = require("node:url");
/**
* Normalizes a domain to lowercase and punycode-encoded.
* Runtime-agnostic equivalent to node's `domainToASCII`.
* @see https://nodejs.org/docs/latest-v22.x/api/url.html#urldomaintoasciidomain
*/
function domainToASCII(domain) {
return new URL(`http://${domain}`).hostname;
}
/**
* Transforms a domain name into a canonical domain name. The canonical domain name is a domain name

@@ -50,3 +57,3 @@ * that has been trimmed, lowercased, stripped of leading dot, and optionally punycode-encoded

}
return (0, node_url_1.domainToASCII)(str).slice(1, -1); // remove [ and ]
return domainToASCII(str).slice(1, -1); // remove [ and ]
}

@@ -56,3 +63,3 @@ // convert to IDN if any non-ASCII characters

if (/[^\u0001-\u007f]/.test(str)) {
return (0, node_url_1.domainToASCII)(str);
return domainToASCII(str);
}

@@ -59,0 +66,0 @@ // ASCII-only domain - not canonicalized with new URL() because it may be a malformed URL

@@ -5,2 +5,2 @@ /**

*/
export declare const version = "5.1.0-rc.0";
export declare const version = "5.1.0";

@@ -8,2 +8,2 @@ "use strict";

*/
exports.version = '5.1.0-rc.0';
exports.version = '5.1.0';

@@ -78,3 +78,3 @@ {

],
"version": "5.1.0-rc.0",
"version": "5.1.0",
"homepage": "https://github.com/salesforce/tough-cookie",

@@ -81,0 +81,0 @@ "repository": {

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