MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / majorOf

Function majorOf

packages/cli/src/utils/autoUpdate.ts:49–52  ·  view source on GitHub ↗

Parse a semver-ish string's major number; returns NaN for pre-releases etc.

(version: string)

Source from the content-addressed store, hash-verified

47
48/** Parse a semver-ish string's major number; returns NaN for pre-releases etc. */
49function majorOf(version: string): number {
50 const match = /^(\d+)\./.exec(version);
51 return match?.[1] ? Number.parseInt(match[1], 10) : Number.NaN;
52}
53
54/**
55 * Quietly log a diagnostic line to `auto-update.log`. Never throws — a bad

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected