Skip to content

Commit 04b30cc

Browse files
committed
wip
1 parent 751f137 commit 04b30cc

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

server/api/registry/badge/[type]/[...pkg].get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ const badgeStrategies = {
383383

384384
const { pkg, typesPackage, files } = await fetchPackageWithTypesAndFiles(
385385
pkgData.name,
386-
requestedVersion,
386+
targetVersion,
387387
)
388388

389389
const typesStatus = detectTypesStatus(pkg, typesPackage, files)

shared/utils/package-analysis.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,19 +319,10 @@ export function detectTypesStatus(
319319
typesPackageInfo?: TypesPackageInfo,
320320
files?: Set<string>,
321321
): TypesStatus {
322-
// Check for built-in types
323-
if (pkg.types || pkg.typings) {
322+
if (hasBuiltInTypes(pkg)) {
324323
return { kind: 'included' }
325324
}
326325

327-
// Check exports field for types
328-
if (pkg.exports) {
329-
const exportInfo = analyzeExports(pkg.exports)
330-
if (exportInfo.hasTypes) {
331-
return { kind: 'included' }
332-
}
333-
}
334-
335326
// Check for implicit types by deriving expected declaration file paths from
336327
// entry points (e.g. .d.mts for .mjs) and checking if they exist in the package
337328
if (files && hasImplicitTypesForEntryPoints(pkg, files)) {

0 commit comments

Comments
 (0)