MCPcopy Create free account
hub / github.com/vercel/vercel / mapSource

Function mapSource

packages/python/src/diagnostics.ts:55–74  ·  view source on GitHub ↗
(src: UvLockPackageSource | undefined)

Source from the content-addressed store, hash-verified

53}
54
55function mapSource(src: UvLockPackageSource | undefined): {
56 source?: string;
57 sourceUrl?: string;
58} {
59 if (!src) return {};
60 if (src.virtual) return {};
61 if (src.registry) {
62 try {
63 const url = new URL(src.registry);
64 return { source: 'registry', sourceUrl: url.origin };
65 } catch {
66 return { source: 'registry', sourceUrl: src.registry };
67 }
68 }
69 if (src.git) return { source: 'git', sourceUrl: src.git };
70 if (src.url) return { source: 'url', sourceUrl: src.url };
71 if (src.editable) return { source: 'editable', sourceUrl: src.editable };
72 if (src.path) return { source: 'path', sourceUrl: src.path };
73 return {};
74}
75
76/**
77 * Generate and write the project manifest to `.vercel/python/package-manifest.json`.

Callers 1

generateProjectManifestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected