MCPcopy Create free account
hub / github.com/FirefoxCSS-Store/FirefoxCSS-Store.github.io / withBasePath

Function withBasePath

src/lib/themes.ts:37–44  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

35}
36
37export function withBasePath(path: string) {
38 if (/^https?:\/\//.test(path)) return path
39
40 const base = import.meta.env.BASE_URL
41 if (base === '/') return path
42
43 return `${base.replace(/\/$/, '')}/${path.replace(/^\//, '')}`
44}
45
46export function publicTheme(theme: Theme) {
47 const { data } = theme

Callers 1

publicThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected