MCPcopy Index your code
hub / github.com/coder/coder / getBaseDocsURL

Function getBaseDocsURL

site/src/utils/docs.ts:28–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26};
27
28const getBaseDocsURL = () => {
29 if (!CACHED_DOCS_URL) {
30 const docsUrl = document
31 .querySelector<HTMLMetaElement>('meta[property="docs-url"]')
32 ?.getAttribute("content");
33
34 const isValidDocsURL = docsUrl && isURL(docsUrl);
35 CACHED_DOCS_URL = isValidDocsURL ? docsUrl : defaultDocsUrl();
36 }
37 return CACHED_DOCS_URL;
38};
39
40const isURL = (value: string) => {
41 try {

Callers 1

docsFunction · 0.85

Calls 2

isURLFunction · 0.85
defaultDocsUrlFunction · 0.85

Tested by

no test coverage detected