From d4512f360b9fe2a4e00408dabd6f38f0cad3617b Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 12 Jan 2023 12:40:20 +0100 Subject: [PATCH] fix: double slash --- packages/webaudio/sampler.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/webaudio/sampler.mjs b/packages/webaudio/sampler.mjs index 7b437ae3..f94b6b5a 100644 --- a/packages/webaudio/sampler.mjs +++ b/packages/webaudio/sampler.mjs @@ -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') {