MCPcopy Index your code
hub / github.com/anomalyco/opencode / parseEntry

Function parseEntry

nix/scripts/canonicalize-node-modules.ts:90–101  ·  view source on GitHub ↗
(label: string)

Source from the content-addressed store, hash-verified

88}
89
90function parseEntry(label: string) {
91 const marker = label.startsWith("@") ? label.indexOf("@", 1) : label.indexOf("@")
92 if (marker <= 0) {
93 return null
94 }
95 const name = label.slice(0, marker).replace(/\+/g, "/")
96 const version = label.slice(marker + 1)
97 if (!name || !version) {
98 return null
99 }
100 return { name, version }
101}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected