MCPcopy Create free account
hub / github.com/chunshand/qdev / isDomain

Function isDomain

admin/src/utils/validate.ts:30–33  ·  view source on GitHub ↗
(domain: string)

Source from the content-addressed store, hash-verified

28
29/** 判断是否为域名(不带协议) */
30export const isDomain = (domain: string) => {
31 const reg = /^([0-9a-zA-Z-]{1,}\.)+([a-zA-Z]{2,})$/
32 return reg.test(domain)
33}
34
35/** 判断版本号格式是否为 X.Y.Z */
36export const isVersion = (version: string) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected