href
A path of the app as a link's address: under the app's base, if it's served under one (/s/1 →
/examples/notes/s/1); one under it already (location.pathname), and other URLs, as they are. navigate takes
either.
export function href(path: string): string { const b = (globalThis as { __TCM_BASE__?: string }).__TCM_BASE__ ?? ""; if ( !path.startsWith("/") || path.startsWith("//") || (b && (path === b || path.startsWith(`${b}/`) || path.startsWith(`${b}?`))) ) return path; return `${b}${path}`; }