emacroh5lib 1.0.74 → 1.0.75
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/package.json
CHANGED
package/src/utilities/EMacro.ts
CHANGED
@@ -65,7 +65,6 @@ export namespace EMacro {
|
|
65
65
|
throw new Error("文件异常")
|
66
66
|
}
|
67
67
|
|
68
|
-
|
69
68
|
for (let i = 0; i < files.length; i++) {
|
70
69
|
const file = files[i];
|
71
70
|
const md5 = await File.getFileMD5(file)
|
@@ -105,7 +104,7 @@ export namespace EMacro {
|
|
105
104
|
completeHandle(files)
|
106
105
|
}
|
107
106
|
|
108
|
-
public static selectFile(options: any = { multiple: true, accept: "*/*" }, isDirectory =
|
107
|
+
public static selectFile(options: any = { multiple: true, accept: "*/*" }, isDirectory = false): Promise<FileList | null> {
|
109
108
|
return new Promise((res: (value: FileList) => void, rej) => {
|
110
109
|
const el = document.createElement("input");
|
111
110
|
el.type = "file";
|
@@ -115,7 +114,7 @@ export namespace EMacro {
|
|
115
114
|
el.addEventListener("change", (_) => {
|
116
115
|
try {
|
117
116
|
if (el.files === null) {
|
118
|
-
rej(null)
|
117
|
+
rej(null);
|
119
118
|
} else {
|
120
119
|
res(el.files);
|
121
120
|
}
|