fix: double slash

This commit is contained in:
Felix Roos 2023-01-12 12:40:20 +01:00
parent 48d0ffe868
commit d4512f360b

View File

@ -124,7 +124,8 @@ let sampleCache = { current: undefined };
export const samples = async (sampleMap, baseUrl = sampleMap._base || '') => {
if (typeof sampleMap === 'string') {
if (sampleMap.startsWith('github:')) {
const [_, path] = sampleMap.split('github:');
let [_, path] = sampleMap.split('github:');
path = path.endsWith('/') ? path.slice(0, -1) : path;
sampleMap = `https://raw.githubusercontent.com/${path}/strudel.json`;
}
if (typeof fetch !== 'function') {