tough-cookie
Advanced tools
Comparing version 5.0.0-rc.4 to 5.0.0
@@ -5,2 +5,3 @@ "use strict"; | ||
const constants_1 = require("./constants"); | ||
const node_url_1 = require("node:url"); | ||
/** | ||
@@ -49,3 +50,3 @@ * Transforms a domain name into a canonical domain name. The canonical domain name is a domain name | ||
} | ||
return new URL(`http://${str}`).hostname.slice(1, -1); // remove [ and ] | ||
return (0, node_url_1.domainToASCII)(str).slice(1, -1); // remove [ and ] | ||
} | ||
@@ -55,3 +56,3 @@ // convert to IDN if any non-ASCII characters | ||
if (/[^\u0001-\u007f]/.test(str)) { | ||
return new URL(`http://${str}`).hostname; | ||
return (0, node_url_1.domainToASCII)(str); | ||
} | ||
@@ -58,0 +59,0 @@ // ASCII-only domain - not canonicalized with new URL() because it may be a malformed URL |
@@ -93,3 +93,3 @@ "use strict"; | ||
// '=' is immediately at start | ||
cookiePair = cookiePair.substr(1); | ||
cookiePair = cookiePair.substring(1); | ||
firstEq = cookiePair.indexOf('='); // might still need to split on '=' | ||
@@ -271,3 +271,3 @@ } | ||
} | ||
catch (e) { | ||
catch { | ||
return undefined; | ||
@@ -274,0 +274,0 @@ } |
@@ -89,3 +89,3 @@ "use strict"; | ||
* domain string is a %x2E (".") character." */ | ||
if (_str.substr(idx - 1, 1) !== '.') { | ||
if (_str.substring(idx - 1, idx) !== '.') { | ||
return false; // doesn't align on "." | ||
@@ -92,0 +92,0 @@ } |
@@ -72,4 +72,7 @@ "use strict"; | ||
// The assertion isn't *strictly* correct, as `T` could be nullish, but, ehh, good enough... | ||
if (err) | ||
reject(err); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
err ? reject(err) : resolve(result); | ||
else | ||
resolve(result); | ||
} | ||
@@ -76,0 +79,0 @@ catch (e) { |
@@ -8,2 +8,2 @@ "use strict"; | ||
*/ | ||
exports.version = '5.0.0-rc.4'; | ||
exports.version = '5.0.0'; |
@@ -78,3 +78,3 @@ { | ||
], | ||
"version": "5.0.0-rc.4", | ||
"version": "5.0.0", | ||
"homepage": "https://github.com/salesforce/tough-cookie", | ||
@@ -122,4 +122,4 @@ "repository": { | ||
"@types/node": "^16.18.101", | ||
"async": "3.2.5", | ||
"eslint": "^8.57.0", | ||
"async": "3.2.6", | ||
"eslint": "^9.9.1", | ||
"eslint-config-prettier": "^9.1.0", | ||
@@ -134,3 +134,3 @@ "eslint-plugin-prettier": "^5.2.1", | ||
"typescript": "5.5.3", | ||
"typescript-eslint": "^7.16.1", | ||
"typescript-eslint": "^8.0.1", | ||
"vows": "^0.8.3" | ||
@@ -137,0 +137,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
224687
41
5078
0