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

Function getRSCUrl

packages/dev/s2-docs/src/pageUtils.ts:27–39  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

25}
26
27export function getRSCUrl(pathname: string) {
28 let url = new URL(pathname, location.href);
29 url.pathname = url.pathname.replace('.html', '');
30 if (url.pathname.endsWith('/')) {
31 url.pathname += 'index.rsc';
32 } else {
33 url.pathname += '.rsc';
34 }
35
36 url.search = '';
37 url.hash = '';
38 return url.href;
39}
40
41export function isClientLink(link: HTMLAnchorElement) {
42 let baseUrl = process.env.LIBRARY

Callers 2

prefetchRouteFunction · 0.90
navigateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected