Skip to content

Commit 71c9f58

Browse files
authored
fix: display correct NPM download count for Config (#496)
* fix: handle empty frameworks in getStats function Updated the getStats function to return a default package format when no frameworks are provided in the library argument. This ensures compatibility for libraries like @tanstack/config. * chore: remove comment
1 parent 5fc8110 commit 71c9f58

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

convex/stats.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ export const getStats = query({
2525
const npmData = args.library
2626
? await ossStats.getNpmPackages(
2727
ctx,
28-
args.library.frameworks.map(
29-
(framework) => `@tanstack/${framework}-${args.library?.id}`
30-
)
28+
args.library.frameworks.length > 0
29+
? args.library.frameworks.map(
30+
(framework) => `@tanstack/${framework}-${args.library?.id}`
31+
)
32+
: [`@tanstack/${args.library.id}`]
3133
)
3234
: await ossStats.getNpmOrg(ctx, 'tanstack')
3335
return {

0 commit comments

Comments
 (0)