toLoad is always an array

This commit is contained in:
tophf 2022-01-26 14:46:49 +03:00
parent f740686cb5
commit ea7c26ce71

View File

@ -78,7 +78,7 @@ if (self.WorkerGlobalScope) {
const toLoad = (Array.isArray(urls) ? urls : [urls])
.map(u => u.endsWith('.js') ? u : u + '.js')
.filter(u => !loadedUrls.includes(u));
if (toLoad) {
if (toLoad.length) {
loadedUrls.push(...toLoad);
importScripts(...toLoad);
}