Socket
Socket
Sign inDemoInstall

keep-a-changelog

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keep-a-changelog - npm Package Compare versions

Comparing version 2.5.2 to 2.5.3

6

CHANGELOG.md

@@ -7,2 +7,6 @@ # Changelog

## [2.5.3] - 2023-11-19
### Fixed
- Improve URL normalization in CLI [#42]
## [2.5.2] - 2023-11-09

@@ -92,3 +96,5 @@ ### Fixed

[#41]: https://github.com/oscarotero/keep-a-changelog/issues/41
[#42]: https://github.com/oscarotero/keep-a-changelog/issues/42
[2.5.3]: https://github.com/oscarotero/keep-a-changelog/compare/v2.5.2...v2.5.3
[2.5.2]: https://github.com/oscarotero/keep-a-changelog/compare/v2.5.1...v2.5.2

@@ -95,0 +101,0 @@ [2.5.1]: https://github.com/oscarotero/keep-a-changelog/compare/v2.5.0...v2.5.1

18

esm/bin.js

@@ -103,2 +103,13 @@ #!/usr/bin/env node

}
function normalizeUrl(url, https) {
// remove .git suffix
url = url.replace(/\.git$/, "");
// normalize git@host urls
if (url.startsWith("git@")) {
url = url.replace(/^git@([^:]+):(.*)$/, (https ? "https" : "http") + "://$1/$2");
}
// remove trailing slashes
url = url.replace(/\/+$/, "");
return new URL(url);
}
function getRemoteUrl(https = true) {

@@ -113,8 +124,3 @@ try {

}
const remoteUrl = new URL(url.replace(/^git@([^:]+):(.*)\.git$/, "https://$1/$2"));
if (https) {
remoteUrl.protocol = "https:";
}
// remove trailing slashes
return remoteUrl.href.replace(/\/+$/, "");
return normalizeUrl(url, https).href;
}

@@ -121,0 +127,0 @@ catch (err) {

@@ -8,3 +8,3 @@ {

"name": "keep-a-changelog",
"version": "2.5.2",
"version": "2.5.3",
"description": "Node package to parse and generate changelogs following the [keepachangelog](https://keepachangelog.com/) format.",

@@ -11,0 +11,0 @@ "homepage": "https://github.com/oscarotero/keep-a-changelog#readme",

@@ -131,2 +131,13 @@ #!/usr/bin/env node

}
function normalizeUrl(url, https) {
// remove .git suffix
url = url.replace(/\.git$/, "");
// normalize git@host urls
if (url.startsWith("git@")) {
url = url.replace(/^git@([^:]+):(.*)$/, (https ? "https" : "http") + "://$1/$2");
}
// remove trailing slashes
url = url.replace(/\/+$/, "");
return new URL(url);
}
function getRemoteUrl(https = true) {

@@ -141,8 +152,3 @@ try {

}
const remoteUrl = new URL(url.replace(/^git@([^:]+):(.*)\.git$/, "https://$1/$2"));
if (https) {
remoteUrl.protocol = "https:";
}
// remove trailing slashes
return remoteUrl.href.replace(/\/+$/, "");
return normalizeUrl(url, https).href;
}

@@ -149,0 +155,0 @@ catch (err) {

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