@zag-js/file-utils 1.4.1 → 1.5.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/index.js CHANGED
@@ -72,7 +72,7 @@ function downloadFile(options) {
72
72
  const { file, win, type, name } = options;
73
73
  const doc = win.document;
74
74
  const obj = typeof file === "string" ? new Blob([file], { type }) : file;
75
- const fileName = typeof file === "string" ? name : file instanceof File ? file.name : void 0;
75
+ const fileName = file instanceof File ? name || file.name : name;
76
76
  if (isMSEdge(win)) {
77
77
  win.navigator.msSaveOrOpenBlob(obj, fileName || "file-download");
78
78
  return;
package/dist/index.mjs CHANGED
@@ -70,7 +70,7 @@ function downloadFile(options) {
70
70
  const { file, win, type, name } = options;
71
71
  const doc = win.document;
72
72
  const obj = typeof file === "string" ? new Blob([file], { type }) : file;
73
- const fileName = typeof file === "string" ? name : file instanceof File ? file.name : void 0;
73
+ const fileName = file instanceof File ? name || file.name : name;
74
74
  if (isMSEdge(win)) {
75
75
  win.navigator.msSaveOrOpenBlob(obj, fileName || "file-download");
76
76
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/file-utils",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "JS File API utilities",
5
5
  "keywords": [
6
6
  "js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "clean-package": "../../../clean-package.config.json",
26
26
  "dependencies": {
27
- "@zag-js/i18n-utils": "1.4.1"
27
+ "@zag-js/i18n-utils": "1.5.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "clean-package": "2.2.0"