MCPcopy Create free account
hub / github.com/echoVic/blade-code / version

Method version

src/ui/utils/validator.ts:180–190  ·  view source on GitHub ↗

* 验证版本号(语义化版本)

(value: string)

Source from the content-addressed store, hash-verified

178 * 验证版本号(语义化版本)
179 */
180 public static version(value: string): boolean | string {
181 if (!value) return true;
182
183 const versionRegex =
184 /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
185 if (!versionRegex.test(value)) {
186 return '请输入有效的版本号 (例如: 1.0.0)';
187 }
188
189 return true;
190 }
191
192 /**
193 * 验证JSON格式

Callers 1

index.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected