MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getBaseUrl

Function getBaseUrl

packages/dev/docs/src/utils.js:59–69  ·  view source on GitHub ↗
(library)

Source from the content-addressed store, hash-verified

57};
58
59export function getBaseUrl(library) {
60 let env = process.env.DOCS_ENV;
61 let base = env ? BASE_URL[env][library] : `http://localhost:1234/${library}`;
62 let publicUrl = process.env.PUBLIC_URL;
63 if (publicUrl) {
64 let url = new URL(base);
65 url.pathname = publicUrl.replace(/\/$/, '') + url.pathname.replace(/\/$/, '');
66 base = url.href;
67 }
68 return base.replace(/\/$/, '');
69}
70
71export function getAnchorProps(href) {
72 if (href.startsWith('v3:') || href.startsWith('react-aria:')) {

Callers 2

MigrationBanner.jsFile · 0.90
getAnchorPropsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected