MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / parseVersion

Function parseVersion

lib/update.ts:178–185  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

176}
177
178function parseVersion(version: string) {
179 const match = version.match(/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+.+)?$/)
180 if (!match) return undefined
181 return {
182 parts: [Number(match[1]), Number(match[2]), Number(match[3])],
183 pre: match[4]?.split(".") ?? [],
184 }
185}

Callers 1

isVersionNewerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected