MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / openURL

Function openURL

data-browser/src/helpers/navigation.tsx:20–29  ·  view source on GitHub ↗
(subject: string)

Source from the content-addressed store, hash-verified

18
19/** Constructs a URL for opening a resource form. */
20export function openURL(subject: string): string {
21 const url = new URL(subject);
22 if (window.location.origin == url.origin) {
23 const path = url.pathname + url.search;
24 if (path == '/') return '';
25 return path;
26 } else {
27 return constructURL(paths.show, 'subject', subject);
28 }
29}
30
31export function searchURL(query: string): string {
32 return constructURL(paths.search, 'query', query);

Callers 12

handleChangeFunction · 0.90
handleSubmitFunction · 0.90
handleClickFunction · 0.90
handleClickFunction · 0.90
SideBar.tsxFile · 0.90
ResourceContextMenuFunction · 0.90
saveFunction · 0.90
SearchFunction · 0.90
constructSubjectFunction · 0.90
RedirectPageFunction · 0.90
handleAcceptFunction · 0.90
versionsURLFunction · 0.85

Calls 1

constructURLFunction · 0.85

Tested by

no test coverage detected