MCPcopy
hub / github.com/liuzi6612/nav / replaceJsdelivrCDN

Function replaceJsdelivrCDN

src/utils/pureUtils.ts:6–19  ·  view source on GitHub ↗
(
  url: string = '',
  settings: ISettings,
)

Source from the content-addressed store, hash-verified

4import type { ISettings, IWebProps, INavProps } from '../types'
5
6export function replaceJsdelivrCDN(
7 url: string = '',
8 settings: ISettings,
9): string {
10 const cdn = settings?.gitHubCDN
11 if (!cdn) {
12 return url
13 }
14 url = url.replace('cdn.jsdelivr.net', cdn)
15 url = url.replace('testingcf.jsdelivr.net', cdn)
16 url = url.replace('img.jsdmirror.com', cdn)
17 url = url.replace('gcore.jsdelivr.net', cdn)
18 return url
19}
20
21export function getIsGitee(gitRepoUrl: string): boolean {
22 return gitRepoUrl.includes('gitee.com')

Callers 4

mainFunction · 0.90
handleAdapterFunction · 0.90
setWebsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected