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

Function isMAC

admin/src/utils/validate.ts:66–70  ·  view source on GitHub ↗
(mac: string)

Source from the content-addressed store, hash-verified

64
65/** 判断是否为 MAC 地址 */
66export const isMAC = (mac: string) => {
67 const reg =
68 /^(([a-f0-9][0,2,4,6,8,a,c,e]:([a-f0-9]{2}:){4})|([a-f0-9][0,2,4,6,8,a,c,e]-([a-f0-9]{2}-){4}))[a-f0-9]{2}$/i
69 return reg.test(mac)
70}
71
72/** 判断是否为 IPv4 地址 */
73export const isIPv4 = (ip: string) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected