Skip to content

Commit 970c358

Browse files
committed
style: add explicit type assertion in resolveGitHubTgzUrl
1 parent dff3ec6 commit 970c358

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

registry/src/lib/packages/operations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,12 @@ export async function resolveGitHubTgzUrl(
327327
apiUrl = gitHubTagRefUrl(user, project, parsedSpec.gitCommittish || '')
328328
} else {
329329
const fetcher = getFetcher()
330+
const versionStr = version as string
330331
// First try to resolve the sha for a tag starting with "v", e.g. v1.2.3.
331-
apiUrl = gitHubTagRefUrl(user, project, `v${version}`)
332+
apiUrl = gitHubTagRefUrl(user, project, `v${versionStr}`)
332333
if (!(await fetcher(apiUrl, { method: 'head' })).ok) {
333334
// If a sha isn't found, try again with the "v" removed, e.g. 1.2.3.
334-
apiUrl = gitHubTagRefUrl(user, project, version)
335+
apiUrl = gitHubTagRefUrl(user, project, versionStr)
335336
if (!(await fetcher(apiUrl, { method: 'head' })).ok) {
336337
apiUrl = ''
337338
}

0 commit comments

Comments
 (0)