MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / compareStableSemver

Function compareStableSemver

packages/node-runtime/src/data-dir-compat.ts:273–283  ·  view source on GitHub ↗
(left: string, right: string)

Source from the content-addressed store, hash-verified

271}
272
273function compareStableSemver(left: string, right: string): number {
274 const leftParts = left.split('.').map(Number)
275 const rightParts = right.split('.').map(Number)
276
277 for (let i = 0; i < 3; i += 1) {
278 if (leftParts[i] > rightParts[i]) return 1
279 if (leftParts[i] < rightParts[i]) return -1
280 }
281
282 return 0
283}
284
285function mergeReasons(existing: string[], next: string): string[] {
286 return [...new Set([...existing, next])]

Callers 2

assertDataDirCompatibleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected