@dev_ailaw/venus 1.370.0 → 1.371.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.
Files changed (2) hide show
  1. package/dist/venus.es.js +8 -3
  2. package/package.json +1 -1
package/dist/venus.es.js CHANGED
@@ -848,10 +848,15 @@ const selectFolderAndCreateZip = async () => {
848
848
  if (handle.kind === "directory") {
849
849
  const currentPath = path2 ? `${path2}/${handle.name}` : handle.name;
850
850
  folderSet.add(currentPath);
851
- for await (const entry of handle.entries()) {
852
- const childHandle = entry[1];
851
+ for await (const [, childHandle] of handle.entries()) {
853
852
  await traverseHandle(childHandle, currentPath);
854
853
  }
854
+ } else if (handle.kind === "file") {
855
+ const file = await handle.getFile();
856
+ if (file.name.includes(".DS_Store"))
857
+ return;
858
+ const filePath = path2 ? `${path2}/${file.name}` : file.name;
859
+ zip.file(filePath, await file.arrayBuffer());
855
860
  }
856
861
  };
857
862
  await traverseHandle(dirHandle, "");
@@ -860,7 +865,7 @@ const selectFolderAndCreateZip = async () => {
860
865
  const blob = await zip.generateAsync({ type: "blob" });
861
866
  const zipFileName = `${dirHandle.name}_package.zip`;
862
867
  return new File([blob], zipFileName, {
863
- type: "text/plain"
868
+ type: "application/zip"
864
869
  });
865
870
  }).then((result) => resolve(result)).catch((err) => {
866
871
  console.log("Directory picker cancelled or failed", err);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.370.0",
6
+ "version": "1.371.0",
7
7
  "files": [
8
8
  "dist"
9
9
  ],