Forked from hermes-frontend, stripped openclaw/bun specifics: - Auth tokens: openclaw_session -> nyx_session - Vite proxy: localhost:3003 -> localhost:8000 (assay) - Prod WS: wss://assay.loop42.de/ws - Workspace paths: removed openclaw-specific paths - Added missing deps: @heroicons/vue, overlayscrollbars-vue - Branding: title -> nyx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
519 B
JavaScript
18 lines
519 B
JavaScript
const postfixRE = /[?#].*$/;
|
|
export function cleanUrl(url) {
|
|
return url.replace(postfixRE, '');
|
|
}
|
|
export function extractQueryWithoutFragment(url) {
|
|
const questionMarkIndex = url.indexOf('?');
|
|
if (questionMarkIndex === -1) {
|
|
return '';
|
|
}
|
|
const fragmentIndex = url.indexOf('#', questionMarkIndex); // Search for # after ?
|
|
if (fragmentIndex === -1) {
|
|
return url.substring(questionMarkIndex);
|
|
}
|
|
else {
|
|
return url.substring(questionMarkIndex, fragmentIndex);
|
|
}
|
|
}
|