@zag-js/file-utils 2.0.0-next.3 → 2.0.0-next.4
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/data-transfer.d.mts +1 -3
- package/dist/data-transfer.d.ts +1 -3
- package/dist/data-transfer.js +47 -80
- package/dist/data-transfer.mjs +43 -55
- package/dist/data-url-to-blob.d.mts +1 -3
- package/dist/data-url-to-blob.d.ts +1 -3
- package/dist/data-url-to-blob.js +11 -36
- package/dist/data-url-to-blob.mjs +7 -11
- package/dist/download-file.d.mts +30 -32
- package/dist/download-file.d.ts +30 -32
- package/dist/download-file.js +43 -72
- package/dist/download-file.mjs +39 -47
- package/dist/get-accept-attr.d.mts +1 -3
- package/dist/get-accept-attr.d.ts +1 -3
- package/dist/get-accept-attr.js +16 -39
- package/dist/get-accept-attr.mjs +12 -14
- package/dist/get-file-data-url.d.mts +1 -3
- package/dist/get-file-data-url.d.ts +1 -3
- package/dist/get-file-data-url.js +19 -45
- package/dist/get-file-data-url.mjs +15 -20
- package/dist/get-file-mime-type.d.mts +2 -5
- package/dist/get-file-mime-type.d.ts +2 -5
- package/dist/get-file-mime-type.js +8 -31
- package/dist/get-file-mime-type.mjs +4 -6
- package/dist/get-total-file-size.d.mts +1 -3
- package/dist/get-total-file-size.d.ts +1 -3
- package/dist/get-total-file-size.js +7 -30
- package/dist/get-total-file-size.mjs +3 -5
- package/dist/index.d.mts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +25 -41
- package/dist/index.mjs +11 -11
- package/dist/is-file-equal.d.mts +2 -4
- package/dist/is-file-equal.d.ts +2 -4
- package/dist/is-file-equal.js +10 -34
- package/dist/is-file-equal.mjs +5 -8
- package/dist/is-valid-file-size.d.mts +2 -5
- package/dist/is-valid-file-size.d.ts +2 -5
- package/dist/is-valid-file-size.js +14 -40
- package/dist/is-valid-file-size.mjs +10 -15
- package/dist/is-valid-file-type.d.mts +3 -6
- package/dist/is-valid-file-type.d.ts +3 -6
- package/dist/is-valid-file-type.js +43 -60
- package/dist/is-valid-file-type.mjs +38 -34
- package/dist/mime-types.d.mts +2 -4
- package/dist/mime-types.d.ts +2 -4
- package/dist/mime-types.js +11 -37
- package/dist/mime-types.mjs +6 -11
- package/dist/types.d.mts +10 -11
- package/dist/types.d.ts +10 -11
- package/dist/types.js +4 -18
- package/dist/types.mjs +1 -0
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
type AnyString = string & {};
|
|
2
|
-
type FileError = "TOO_MANY_FILES" | "FILE_INVALID_TYPE" | "FILE_TOO_LARGE" | "FILE_TOO_SMALL" | "FILE_INVALID" | "FILE_EXISTS" | AnyString;
|
|
3
|
-
type ImageFileMimeType = "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp";
|
|
4
|
-
type ApplicationFileMimeType = "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable";
|
|
5
|
-
type TextFileMimeType = "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain";
|
|
6
|
-
type FontFileMimeType = "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg";
|
|
7
|
-
type VideoFileMimeType = "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo";
|
|
8
|
-
type AudioFileMimeType = "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a";
|
|
9
|
-
type FileMimeTypeGroup = "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*";
|
|
10
|
-
type FileMimeType = ImageFileMimeType | ApplicationFileMimeType | TextFileMimeType | FontFileMimeType | VideoFileMimeType | AudioFileMimeType | FileMimeTypeGroup | AnyString;
|
|
11
|
-
|
|
12
|
-
export type { ApplicationFileMimeType, AudioFileMimeType, FileError, FileMimeType, FileMimeTypeGroup, FontFileMimeType, ImageFileMimeType, TextFileMimeType, VideoFileMimeType };
|
|
2
|
+
export type FileError = "TOO_MANY_FILES" | "FILE_INVALID_TYPE" | "FILE_TOO_LARGE" | "FILE_TOO_SMALL" | "FILE_INVALID" | "FILE_EXISTS" | AnyString;
|
|
3
|
+
export type ImageFileMimeType = "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp";
|
|
4
|
+
export type ApplicationFileMimeType = "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable";
|
|
5
|
+
export type TextFileMimeType = "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain";
|
|
6
|
+
export type FontFileMimeType = "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg";
|
|
7
|
+
export type VideoFileMimeType = "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo";
|
|
8
|
+
export type AudioFileMimeType = "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a";
|
|
9
|
+
export type FileMimeTypeGroup = "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*";
|
|
10
|
+
export type FileMimeType = ImageFileMimeType | ApplicationFileMimeType | TextFileMimeType | FontFileMimeType | VideoFileMimeType | AudioFileMimeType | FileMimeTypeGroup | AnyString;
|
|
11
|
+
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types.ts
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
package/dist/types.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/file-utils",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.4",
|
|
4
4
|
"description": "JS File API utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"clean-package": "../../../clean-package.config.json",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/i18n-utils": "2.0.0-next.
|
|
30
|
+
"@zag-js/i18n-utils": "2.0.0-next.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"clean-package": "2.2.0",
|
|
34
|
-
"vitest": "^
|
|
34
|
+
"vitest": "^5.0.0"
|
|
35
35
|
},
|
|
36
36
|
"module": "dist/index.mjs",
|
|
37
37
|
"types": "dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"./package.json": "./package.json"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "
|
|
52
|
+
"build": "tsdown",
|
|
53
53
|
"test": "vitest",
|
|
54
54
|
"lint": "oxlint src",
|
|
55
55
|
"typecheck": "tsc --noEmit",
|