npm-check-updates 11.2.3 → 11.3.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.
|
@@ -11,12 +11,22 @@ const getSortedVersions = async (name, declaration, options) => {
|
|
|
11
11
|
// if present, github: is parsed as the protocol. This is not valid when passed into remote-git-tags.
|
|
12
12
|
declaration = declaration.replace(/^github:/, '')
|
|
13
13
|
const { auth, protocol, host, path } = parseGithubUrl(declaration)
|
|
14
|
-
|
|
14
|
+
let tagsPromise = Promise.resolve()
|
|
15
|
+
const protocolKnown = protocol != null
|
|
16
|
+
if (protocolKnown) {
|
|
17
|
+
tagsPromise = tagsPromise.then(() => remoteGitTags(`${protocol ? protocol.replace('git+', '') : 'https:'}//${auth ? auth + '@' : ''}${host}/${path}`))
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// try ssh first, then https on failure
|
|
21
|
+
tagsPromise = tagsPromise.then(() => remoteGitTags(`ssh://git@${host}/${path}`))
|
|
22
|
+
.catch(() => remoteGitTags(`https://${auth ? auth + '@' : ''}${host}/${path}`))
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
let tagMap = new Map()
|
|
16
26
|
|
|
17
27
|
// fetch remote tags
|
|
18
28
|
try {
|
|
19
|
-
tagMap = await
|
|
29
|
+
tagMap = await tagsPromise
|
|
20
30
|
}
|
|
21
31
|
// catch a variety of errors that occur on invalid or private repos
|
|
22
32
|
catch (e) {
|