MCPcopy Create free account
hub / github.com/anomalyco/opencode / setVersion

Function setVersion

script/upgrade-opentui.ts:45–53  ·  view source on GitHub ↗
(cur: string, kind: "dep" | "peer")

Source from the content-addressed store, hash-verified

43)
44
45const setVersion = (cur: string, kind: "dep" | "peer") => {
46 if (cur === "catalog:" || cur.startsWith("workspace:")) return cur
47 if (snapshot) return ver
48 if (kind === "peer") return `>=${ver}`
49 if (cur.startsWith(">=")) return `>=${ver}`
50 if (cur.startsWith("^")) return `^${ver}`
51 if (cur.startsWith("~")) return `~${ver}`
52 return ver
53}
54
55const editDeps = (obj: unknown, kind: "dep" | "peer") => {
56 if (!obj || typeof obj !== "object") return false

Callers 1

editDepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected