@vltpkg/git-scp-url 1.6.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ const correctUrl = (url) => {
|
|
|
38
38
|
const firstAt = url.indexOf('@');
|
|
39
39
|
const lastHash = url.lastIndexOf('#');
|
|
40
40
|
let firstColon = url.indexOf(':');
|
|
41
|
-
|
|
41
|
+
const lastColon = url.lastIndexOf(':', lastHash > -1 ? lastHash : Infinity);
|
|
42
42
|
let corrected = url;
|
|
43
43
|
if (lastColon > firstAt) {
|
|
44
44
|
// the last : comes after the first @ (or there is no @)
|
|
@@ -53,9 +53,8 @@ const correctUrl = (url) => {
|
|
|
53
53
|
// then we replace the last : with a / to create a valid path
|
|
54
54
|
corrected =
|
|
55
55
|
url.slice(0, lastColon) + '/' + url.slice(lastColon + 1);
|
|
56
|
-
//
|
|
56
|
+
// and we find our new first : position
|
|
57
57
|
firstColon = corrected.indexOf(':');
|
|
58
|
-
lastColon = corrected.lastIndexOf(':');
|
|
59
58
|
}
|
|
60
59
|
if (firstColon === -1 && !url.includes('//')) {
|
|
61
60
|
// we have no : at all
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/git-scp-url",
|
|
3
3
|
"description": "Parse scp-style git URLs like `git+ssh://host:some/path`",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@eslint/js": "^
|
|
16
|
+
"@eslint/js": "^10.0.1",
|
|
17
17
|
"@types/node": "^22.19.2",
|
|
18
|
-
"eslint": "^
|
|
18
|
+
"eslint": "^10.14.0",
|
|
19
19
|
"prettier": "^3.7.4",
|
|
20
20
|
"tap": "^21.8.0",
|
|
21
21
|
"typedoc": "~0.27.9",
|
|
22
22
|
"typescript": "5.7.3",
|
|
23
|
-
"typescript-eslint": "^8.
|
|
23
|
+
"typescript-eslint": "^8.56.0"
|
|
24
24
|
},
|
|
25
25
|
"license": "BSD-2-Clause-Patent",
|
|
26
26
|
"engines": {
|