Merge remote-tracking branch 'origin/main' into glossing/sounds-tab-preview
This commit is contained in:
parent
74488f8480
commit
b824c45ba4
26 changed files with 777 additions and 133 deletions
|
|
@ -114,3 +114,13 @@ export function getCommonSampleInfo(hapValue, bank) {
|
|||
export const pickAndRename = (source, map) => {
|
||||
return Object.fromEntries(Object.entries(map).map(([newKey, oldKey]) => [newKey, source[oldKey]]));
|
||||
};
|
||||
|
||||
export const getBaseURL = (url) => {
|
||||
try {
|
||||
// For real URLs
|
||||
return new URL('.', new URL(url)).href.replace(/\/$/, ''); // removes trailing slash
|
||||
} catch {
|
||||
// For pseudo URLS
|
||||
return url.split('/').slice(0, -1).join('/');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue