File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import type {
88import { encodePackageName } from '#shared/utils/npm'
99import type { PackageAnalysisResponse } from './usePackageAnalysis'
1010import { isBinaryOnlyPackage } from '#shared/utils/binary-detection'
11- import { getDependencyCount } from './useNpmRegistry '
11+ import { getDependencyCount } from '~/utils/npm/common '
1212
1313export interface PackageComparisonData {
1414 package : ComparisonPackage
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { joinURL } from 'ufo'
1111import { areUrlsEquivalent } from ' #shared/utils/url'
1212import { isEditableElement } from ' ~/utils/input'
1313import { formatBytes } from ' ~/utils/formatters'
14+ import { getDependencyCount } from ' ~/utils/npm/common'
1415import { NuxtLink } from ' #components'
1516
1617definePageMeta ({
Original file line number Diff line number Diff line change @@ -12,3 +12,8 @@ export const NPM_API = 'https://api.npmjs.org'
1212export function buildScopeTeam ( orgName : string , teamName : string ) : `@${string } :${string } ` {
1313 return `@${ orgName . replace ( / ^ @ / , '' ) } :${ teamName } `
1414}
15+
16+ export function getDependencyCount ( version : PackumentVersion | null ) : number {
17+ if ( ! version ?. dependencies ) return 0
18+ return Object . keys ( version . dependencies ) . length
19+ }
You can’t perform that action at this time.
0 commit comments