MCPcopy
hub / github.com/npmx-dev/npmx.dev / resolveDependencyVersions

Function resolveDependencyVersions

server/utils/npm.ts:78–96  ·  view source on GitHub ↗
(
  dependencies: Record<string, string>,
)

Source from the content-addressed store, hash-verified

76 * Returns a map of package name to resolved version.
77 */
78export async function resolveDependencyVersions(
79 dependencies: Record<string, string>,
80): Promise<Record<string, string>> {
81 const entries = Object.entries(dependencies)
82 const results = await Promise.all(
83 entries.map(async ([name, constraint]) => {
84 const resolved = await resolveVersionConstraint(name, constraint)
85 return [name, resolved] as const
86 }),
87 )
88
89 const resolved: Record<string, string> = {}
90 for (const [name, version] of results) {
91 if (version) {
92 resolved[name] = version
93 }
94 }
95 return resolved
96}
97
98/**
99 * Find a user's email address from its username

Callers 1

[...pkg].get.tsFile · 0.85

Calls 1

resolveVersionConstraintFunction · 0.85

Tested by

no test coverage detected