@lvce-editor/file-system-worker 3.0.0 → 3.1.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.
@@ -1860,10 +1860,18 @@ const writeFile = async (uri, content) => {
1860
1860
  }
1861
1861
  return writeFile$2(uri, content);
1862
1862
  };
1863
- const writeBlob = async (uri, blob) => {
1863
+ const getBytes = async blob => {
1864
+ if (blob.bytes) {
1865
+ return blob.bytes();
1866
+ }
1864
1867
  const buffer = await blob.arrayBuffer();
1868
+ const bytes = new Uint8Array(buffer);
1869
+ return bytes;
1870
+ };
1871
+ const writeBlob = async (uri, blob) => {
1872
+ const bytes = await getBytes(blob);
1865
1873
  // @ts-ignore
1866
- await invoke('FileSystem.writeBuffer', uri, buffer);
1874
+ await invoke('FileSystem.writeBuffer', uri, bytes);
1867
1875
  };
1868
1876
  const mkdir = async uri => {
1869
1877
  return mkdir$1(uri);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-system-worker",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "File System Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"