MCPcopy Create free account
hub / github.com/baiwumm/react-admin / isHttpLink

Function isHttpLink

Xmw_web/src/utils/index.ts:203–212  ·  view source on GitHub ↗
(link: string)

Source from the content-addressed store, hash-verified

201 * @Author: 白雾茫茫丶
202 */
203export const isHttpLink = (link: string): boolean => {
204 const pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
205 '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
206 '((\\d{1,3}\\.){3}\\\d{1,3}))' + // OR ip (v4) address
207 '(\\:\\d+)?' + // port
208 '(\\/[-a-z\\d%_.~+]*)*' + // path
209 '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
210 '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
211 return pattern.test(link);
212}
213
214/**
215 * @description: 默认不显示的 column 项

Callers 1

UploadImageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected