()
| 26 | }; |
| 27 | |
| 28 | const 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 | |
| 40 | const isURL = (value: string) => { |
| 41 | try { |
no test coverage detected