MCPcopy Create free account
hub / github.com/pingcap/docs-cn / isInternalDocLink

Function isInternalDocLink

scripts/verify-internal-links-in-toc.js:47–54  ·  view source on GitHub ↗
(url = "")

Source from the content-addressed store, hash-verified

45}
46
47function isInternalDocLink(url = "") {
48 if (!url) return false;
49 if (isExternalUrl(url)) return false;
50 if (!url.startsWith("/")) return false;
51 if (url.startsWith("/media/")) return false;
52 const { path: p } = stripQueryAndHash(url);
53 return p.endsWith(".md") || p.endsWith(".mdx");
54}
55
56function toTargetRel(url = "") {
57 return stripQueryAndHash(url).path.replace(/^\/+/, "");

Callers 1

Calls 2

isExternalUrlFunction · 0.85
stripQueryAndHashFunction · 0.85

Tested by

no test coverage detected