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

Function wasmEntryToRequirement

packages/python-analysis/src/manifest/pep508.ts:129–151  ·  view source on GitHub ↗

* Convert a WASM-parsed PEP 508 entry to a NormalizedRequirement.

(entry: ParsedReqEntry)

Source from the content-addressed store, hash-verified

127 * Convert a WASM-parsed PEP 508 entry to a NormalizedRequirement.
128 */
129function wasmEntryToRequirement(entry: ParsedReqEntry): NormalizedRequirement {
130 const req: NormalizedRequirement = {
131 name: entry.name || '',
132 };
133
134 if (entry.versionSpec) {
135 req.version = entry.versionSpec;
136 }
137
138 if (entry.extras.length > 0) {
139 req.extras = entry.extras;
140 }
141
142 if (entry.markers) {
143 req.markers = entry.markers;
144 }
145
146 if (entry.url) {
147 req.url = entry.url;
148 }
149
150 return req;
151}
152
153/**
154 * Parse a single PEP 508 dependency string into a NormalizedRequirement.

Callers 1

parsePep508Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected