@lvce-editor/test-worker 13.22.0 → 13.23.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.
package/dist/api.d.ts CHANGED
@@ -462,6 +462,7 @@ interface FileSystem {
462
462
  readonly createDroppedFileHandle: () => Promise<DroppedFileHandle>;
463
463
  readonly createExecutable: (content: string) => Promise<string>;
464
464
  readonly createExecutableFrom: (uri: string) => Promise<string>;
465
+ readonly getOpfsRoot: () => Promise<FileSystemDirectoryHandle>;
465
466
  readonly getTmpDir: ({ scheme }?: FileSystemTmpDirOptions) => Promise<string>;
466
467
  readonly loadFixture: (url: string) => Promise<string>;
467
468
  readonly mkdir: (uri: string) => Promise<void>;
@@ -3165,8 +3165,11 @@ const createExecutableFrom = async uri => {
3165
3165
  const content = await invoke('Ajax.getText', absolutePath);
3166
3166
  return createExecutable(content);
3167
3167
  };
3168
+ const getOpfsRoot = async () => {
3169
+ return navigator.storage.getDirectory();
3170
+ };
3168
3171
  const createDroppedFileHandle = async () => {
3169
- const directory = await navigator.storage.getDirectory();
3172
+ const directory = await getOpfsRoot();
3170
3173
  const fileHandle = await directory.getFileHandle('dropped-file.txt', {
3171
3174
  create: true
3172
3175
  });
@@ -3193,6 +3196,7 @@ const FileSystem = {
3193
3196
  createDroppedFileHandle,
3194
3197
  createExecutable,
3195
3198
  createExecutableFrom,
3199
+ getOpfsRoot,
3196
3200
  getTmpDir,
3197
3201
  loadFixture,
3198
3202
  mkdir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.22.0",
3
+ "version": "13.23.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",