@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.
Files changed (2) hide show
  1. package/dist/pure.js +6 -1
  2. 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.toString().replace(/^file:\/+/, "/");
355
+ return stripProtocol(url);
351
356
  }
352
357
 
353
358
  function createWorkerConstructor(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/web-worker",
3
3
  "type": "module",
4
- "version": "0.34.3",
4
+ "version": "0.34.4",
5
5
  "description": "Web Worker support for testing in Vitest",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",