MCPcopy Create free account
hub / github.com/tiann/hapi / parseVersionTuple

Function parseVersionTuple

cli/src/codex/utils/codexVersion.ts:9–20  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

7const SEMVER_PATTERN = /\b(\d+)\.(\d+)\.(\d+)\b/
8
9function parseVersionTuple(value: string): [number, number, number] | null {
10 const match = value.match(SEMVER_PATTERN)
11 if (!match) {
12 return null
13 }
14
15 return [
16 Number.parseInt(match[1], 10),
17 Number.parseInt(match[2], 10),
18 Number.parseInt(match[3], 10)
19 ]
20}
21
22function getLocalModeRequirementMessage(): string {
23 return `Codex CLI ${MIN_CODEX_HOOKS_VERSION}+ is required for hapi codex local mode because HAPI depends on stable hooks.`

Callers 2

parseCodexVersionFunction · 0.85
isCodexVersionAtLeastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected