mirror of
https://github.com/MioMioOS/MioIsland
synced 2026-04-24 15:07:33 +00:00
Replace with native .bundle plugin architecture in next commits. Old declarative system (themes/buddy/sound JSON) removed entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
17 lines
519 B
JavaScript
17 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);
|
|
}
|
|
}
|