Skip to content

Commit

Permalink
fix(deps): bump hosted-git-info from 6.0.0 to 6.1.1 (#700)
Browse files Browse the repository at this point in the history
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 6.0.0 to 6.1.1.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/main/CHANGELOG.md)
- [Commits](npm/hosted-git-info@v6.0.0...v6.1.1)

---
updated-dependencies:
- dependency-name: hosted-git-info
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ybiquitous <ybiquitous@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ybiquitous committed Nov 8, 2022
1 parent 34fb6f7 commit d86ffbc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 29 deletions.
57 changes: 36 additions & 21 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4054,21 +4054,20 @@ var require_hosts = __commonJS({
}
});

// node_modules/hosted-git-info/lib/from-url.js
var require_from_url = __commonJS({
"node_modules/hosted-git-info/lib/from-url.js"(exports, module2) {
"use strict";
// node_modules/hosted-git-info/lib/parse-url.js
var require_parse_url = __commonJS({
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module2) {
var url = require("url");
var lastIndexOfBefore = (str, char, beforeChar) => {
const startPosition = str.indexOf(beforeChar);
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
};
var safeUrl = (u) => {
try {
return new url.URL(u);
} catch {
}
};
var lastIndexOfBefore = (str, char, beforeChar) => {
const startPosition = str.indexOf(beforeChar);
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
};
var correctProtocol = (arg, protocols) => {
const firstColon = arg.indexOf(":");
const proto = arg.slice(0, firstColon + 1);
Expand All @@ -4089,6 +4088,29 @@ var require_from_url = __commonJS({
}
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
};
var correctUrl = (giturl) => {
const firstAt = lastIndexOfBefore(giturl, "@", "#");
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
if (lastColonBeforeHash > firstAt) {
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
}
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
giturl = `git+ssh://${giturl}`;
}
return giturl;
};
module2.exports = (giturl, protocols) => {
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
};
}
});

// node_modules/hosted-git-info/lib/from-url.js
var require_from_url = __commonJS({
"node_modules/hosted-git-info/lib/from-url.js"(exports, module2) {
"use strict";
var parseUrl = require_parse_url();
var isGitHubShorthand = (arg) => {
const firstHash = arg.indexOf("#");
const firstSlash = arg.indexOf("/");
Expand All @@ -4105,23 +4127,12 @@ var require_from_url = __commonJS({
const doesNotStartWithDot = !arg.startsWith(".");
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
};
var correctUrl = (giturl) => {
const firstAt = lastIndexOfBefore(giturl, "@", "#");
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
if (lastColonBeforeHash > firstAt) {
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
}
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
giturl = `git+ssh://${giturl}`;
}
return giturl;
};
module2.exports = (giturl, opts, { gitHosts, protocols }) => {
if (!giturl) {
return;
}
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : correctProtocol(giturl, protocols);
const parsed = safeUrl(correctedUrl) || safeUrl(correctUrl(correctedUrl));
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
const parsed = parseUrl(correctedUrl, protocols);
if (!parsed) {
return;
}
Expand Down Expand Up @@ -4196,6 +4207,7 @@ var require_lib2 = __commonJS({
var LRU = require_lru_cache();
var hosts = require_hosts();
var fromUrl = require_from_url();
var parseUrl = require_parse_url();
var cache2 = new LRU({ max: 1e3 });
var _gitHosts, _protocols, _fill, fill_fn;
var _GitHost = class {
Expand Down Expand Up @@ -4231,6 +4243,9 @@ var require_lib2 = __commonJS({
}
return cache2.get(key);
}
static parseUrl(url) {
return parseUrl(url);
}
hash() {
return this.committish ? `#${this.committish}` : "";
}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"hosted-git-info": "^6.0.0"
"hosted-git-info": "^6.1.1"
},
"devDependencies": {
"@jest/globals": "^29.0.3",
Expand Down

0 comments on commit d86ffbc

Please sign in to comment.