Skip to content

Commit

Permalink
Fix homepage URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Oct 27, 2022
1 parent cc0b295 commit 46e5665
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bundles/@yarnpkg/plugin-outdated.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/DependencyFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DependencyFetcher {
return {
latest: latest.range,
range: range?.range,
url: homepageURL ?? "",
url: homepageURL ?? undefined,
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export function getHomepageURL({ raw: manifest }: Manifest): string | null {
? repo.url
: null

return (repoURL && fromUrl(repoURL)?.browse()) || repoURL
const info = repoURL ? fromUrl(repoURL) : undefined
const commitish = info?.committish ? `#${info.committish}` : ""

return info
? `https://${info.domain}/${info.user}/${info.project}${commitish}`
: repoURL
}

/**
Expand Down

0 comments on commit 46e5665

Please sign in to comment.