@lvce-editor/test-worker 11.2.0 → 11.3.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.
@@ -1171,6 +1171,9 @@ const sendMessagePortToEditorWorker = async (port, rpcId) => {
1171
1171
  // @ts-ignore
1172
1172
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1173
1173
  };
1174
+ const readFile$1 = async uri => {
1175
+ return invoke('FileSystem.readFile', uri);
1176
+ };
1174
1177
  const getPreference = async key => {
1175
1178
  return await invoke('Preferences.get', key);
1176
1179
  };
@@ -2606,24 +2609,25 @@ const toFileUrl = url => {
2606
2609
  return `file://${rest}`;
2607
2610
  };
2608
2611
 
2609
- /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
2610
- const getDirents = async (allDirents, fileUrl) => {
2612
+ const getDirents = async fileUrl => {
2613
+ const allDirents = [];
2611
2614
  const dirents = await invoke('FileSystem.readDirWithFileTypes', fileUrl);
2612
2615
  for (const dirent of dirents) {
2613
2616
  if (dirent.type === Directory) {
2614
- await getDirents(allDirents, `${fileUrl}/${dirent.name}`);
2617
+ const subDirents = await getDirents(`${fileUrl}/${dirent.name}`);
2618
+ allDirents.push(...subDirents);
2615
2619
  } else {
2616
2620
  allDirents.push(`${fileUrl}/${dirent.name}`);
2617
2621
  }
2618
2622
  }
2623
+ return allDirents;
2619
2624
  };
2620
2625
  const getFileMapNode = async url => {
2621
2626
  const fileUrl = toFileUrl(url);
2622
- const allFiles = [];
2623
- await getDirents(allFiles, fileUrl);
2627
+ const allFiles = await getDirents(fileUrl);
2624
2628
  const fileMap = Object.create(null);
2625
2629
  for (const filePath of allFiles) {
2626
- const content = await invoke(`FileSystem.readFile`, filePath);
2630
+ const content = await readFile$1(filePath);
2627
2631
  const relativePaths = filePath.slice(fileUrl.length + 1);
2628
2632
  fileMap[relativePaths] = content;
2629
2633
  }
@@ -3461,7 +3465,7 @@ const handleInputContextMenu = async (name, button, x, y) => {
3461
3465
  await invoke('Search.handleInputConextMenu', name, button, x, y);
3462
3466
  };
3463
3467
  const handleContextMenu$2 = async (button, x, y) => {
3464
- await invoke('Search.handleContextMenu', name, button, x, y);
3468
+ await invoke('Search.handleContextMenu', button, x, y);
3465
3469
  };
3466
3470
 
3467
3471
  const Search = {
@@ -3519,8 +3523,7 @@ const clear = async searchValue => {
3519
3523
  return invoke('Settings.clear', searchValue, Script);
3520
3524
  };
3521
3525
  const clearHistory = async () => {
3522
- // @ts-ignore
3523
- return invoke('Settings.clearHistory', searchValue, Script);
3526
+ return invoke('Settings.clearHistory');
3524
3527
  };
3525
3528
  const selectTab = async tabId => {
3526
3529
  return invoke('Settings.handleClickTab', tabId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",