@vitest/web-worker 0.34.3 → 0.34.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pure.js +6 -1
- package/package.json +1 -1
package/dist/pure.js
CHANGED
@@ -342,12 +342,17 @@ function getRunnerOptions() {
|
|
342
342
|
state
|
343
343
|
};
|
344
344
|
}
|
345
|
+
function stripProtocol(url) {
|
346
|
+
return url.toString().replace(/^file:\/+/, "/");
|
347
|
+
}
|
345
348
|
function getFileIdFromUrl(url) {
|
349
|
+
if (typeof self === "undefined")
|
350
|
+
return stripProtocol(url);
|
346
351
|
if (!(url instanceof URL))
|
347
352
|
url = new URL(url, self.location.origin);
|
348
353
|
if (url.protocol === "http:" || url.protocol === "https:")
|
349
354
|
return url.pathname;
|
350
|
-
return url
|
355
|
+
return stripProtocol(url);
|
351
356
|
}
|
352
357
|
|
353
358
|
function createWorkerConstructor(options) {
|