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

Function isExternal

admin/src/utils/validate.ts:12–15  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

10
11/** 判断是否为外链 */
12export const isExternal = (path: string) => {
13 const reg = /^(https?:|mailto:|tel:)/
14 return reg.test(path)
15}
16
17/** 判断是否为网址(带协议) */
18export const isUrl = (url: string) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected