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

Function validateCliVersion

scripts/cli-options.ts:152–160  ·  view source on GitHub ↗
(
  version: string,
  pattern: RegExp,
  fail: (message: string) => never,
)

Source from the content-addressed store, hash-verified

150}
151
152export function validateCliVersion(
153 version: string,
154 pattern: RegExp,
155 fail: (message: string) => never,
156) {
157 if (!pattern.test(version)) {
158 fail(`Invalid semver: ${version}`);
159 }
160}
161
162export function validateCliDate(date: string, fail: (message: string) => never) {
163 if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {

Callers 3

finalizeOptionsFunction · 0.90
finalizeOptionsFunction · 0.90

Calls 1

failFunction · 0.70

Tested by

no test coverage detected