@lvce-editor/test-worker 6.7.0 → 6.8.0

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.
@@ -2562,14 +2562,17 @@ const createDroppedFileHandle = async () => {
2562
2562
  };
2563
2563
  };
2564
2564
  const loadFixture = async (platform, url) => {
2565
+ if (typeof url !== 'string') {
2566
+ throw new TypeError(`fixture url must be of type string`);
2567
+ }
2565
2568
  // Handle fixture URLs in web environment
2566
2569
  if (platform === Web) {
2567
2570
  const fileMapUrl = `${url}/fileMap.json`;
2568
- // @ts-ignore
2569
- loadFileMap(fileMapUrl);
2570
- // TODO add those files to memory file system
2571
- // TODO then return the memory file system url
2572
- return '';
2571
+ const fileMap = await loadFileMap(fileMapUrl);
2572
+ for (const [key, value] of Object.entries(fileMap)) {
2573
+ await writeFile(`memfs:///${key}`, value);
2574
+ }
2575
+ return 'memfs:///';
2573
2576
  }
2574
2577
 
2575
2578
  // TODO maybe also create a memory file system for consistency with web
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",