@tauri-apps/plugin-fs 2.6.0 → 2.7.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-js/index.cjs CHANGED
@@ -734,7 +734,9 @@ async function writeFile(path, data, options) {
734
734
  read: false,
735
735
  create: true,
736
736
  write: true,
737
- ...options
737
+ ...options,
738
+ // overwrite the previous contents, like when writing a buffer
739
+ truncate: !options?.append
738
740
  });
739
741
  const reader = data.getReader();
740
742
  try {
package/dist-js/index.js CHANGED
@@ -732,7 +732,9 @@ async function writeFile(path, data, options) {
732
732
  read: false,
733
733
  create: true,
734
734
  write: true,
735
- ...options
735
+ ...options,
736
+ // overwrite the previous contents, like when writing a buffer
737
+ truncate: !options?.append
736
738
  });
737
739
  const reader = data.getReader();
738
740
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-fs",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Access the file system.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "authors": [