MCPcopy Create free account
hub / github.com/Noumena-Network/code / compareVersion

Function compareVersion

src/tools/REPLTool/pyReplFactory.tsx:170–180  ·  view source on GitHub ↗
(left: readonly number[], right: readonly number[])

Source from the content-addressed store, hash-verified

168}
169
170function compareVersion(left: readonly number[], right: readonly number[]): number {
171 const length = Math.max(left.length, right.length)
172 for (let index = 0; index < length; index += 1) {
173 const leftValue = left[index] ?? 0
174 const rightValue = right[index] ?? 0
175 if (leftValue !== rightValue) {
176 return leftValue - rightValue
177 }
178 }
179 return 0
180}
181
182function parsePythonVersion(stdout: string): number[] | null {
183 const match = stdout.trim().match(/^(\d+)\.(\d+)\.(\d+)/)

Callers 1

resolvePythonExecutableFunction · 0.85

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected