Skip to content

Commit e4886a5

Browse files
[autofix.ci] apply automated fixes
1 parent 144e806 commit e4886a5

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

app/composables/usePackageComparison.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface PackageComparisonData {
4747
/** Creation date of the package (ISO 8601 date-time string) */
4848
createdAt?: string
4949
engines?: { node?: string; npm?: string }
50-
deprecated?: string,
50+
deprecated?: string
5151
github?: {
5252
stars?: number
5353
issues?: number
@@ -138,8 +138,16 @@ export function usePackageComparison(packageNames: MaybeRefOrGetter<string[]>) {
138138
$fetch<PackageLikes>(`/api/social/likes/${encodePackageName(name)}`).catch(
139139
() => null,
140140
),
141-
$fetch<{ repo: { stars: number } }>(`https://ungh.cc/repos/${parseRepositoryInfo(pkgData.repository)?.owner}/${parseRepositoryInfo(pkgData.repository)?.repo}`).then(res => res?.repo.stars || 0).catch(() => null),
142-
$fetch<{issues: number}>(`/api/github/issues/${parseRepositoryInfo(pkgData.repository)?.owner}/${parseRepositoryInfo(pkgData.repository)?.repo}`).then(res => res?.issues || 0).catch(() => null),
141+
$fetch<{ repo: { stars: number } }>(
142+
`https://ungh.cc/repos/${parseRepositoryInfo(pkgData.repository)?.owner}/${parseRepositoryInfo(pkgData.repository)?.repo}`,
143+
)
144+
.then(res => res?.repo.stars || 0)
145+
.catch(() => null),
146+
$fetch<{ issues: number }>(
147+
`/api/github/issues/${parseRepositoryInfo(pkgData.repository)?.owner}/${parseRepositoryInfo(pkgData.repository)?.repo}`,
148+
)
149+
.then(res => res?.issues || 0)
150+
.catch(() => null),
143151
])
144152
const versionData = pkgData.versions[latestVersion]
145153
const packageSize = versionData?.dist?.unpackedSize
@@ -264,7 +272,7 @@ export function usePackageComparison(packageNames: MaybeRefOrGetter<string[]>) {
264272

265273
return packagesData.value.map(pkg => {
266274
if (!pkg) return null
267-
console.log(pkg.package.name, {pkg})
275+
console.log(pkg.package.name, { pkg })
268276
return computeFacetValue(
269277
facet,
270278
pkg,

server/api/github/issues/[owner]/[repo].get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default defineCachedEventHandler(
5151
maxAge: CACHE_MAX_AGE_ONE_HOUR,
5252
swr: true,
5353
name: 'github-issue-count',
54-
getKey: (event) => {
54+
getKey: event => {
5555
const owner = getRouterParam(event, 'owner')
5656
const repo = getRouterParam(event, 'repo')
5757
return `${owner}/${repo}`

shared/types/comparison.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type ComparisonFacet =
2121
| 'githubIssues'
2222
| 'createdAt'
2323

24-
2524
/** Facet metadata for UI display */
2625
export interface FacetInfo {
2726
id: ComparisonFacet

0 commit comments

Comments
 (0)