@zykj2024/much-library 1.1.7-beta.11 → 1.1.7-beta.12
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/esm/index.d.ts +1 -4
- package/dist/esm/index.js +1 -3
- package/package.json +2 -2
- package/dist/esm/McUpload/comps/McFormUpload/comps/UploadForVal/index.d.ts +0 -38
- package/dist/esm/McUpload/comps/McFormUpload/comps/UploadForVal/index.js +0 -209
- package/dist/esm/McUpload/comps/McFormUpload/comps/UploadForVal/index.less +0 -6
- package/dist/esm/McUpload/comps/McFormUpload/index.d.ts +0 -7
- package/dist/esm/McUpload/comps/McFormUpload/index.js +0 -29
- package/dist/esm/McUpload/comps/McUploadCmp/index.d.ts +0 -49
- package/dist/esm/McUpload/comps/McUploadCmp/index.js +0 -396
- package/dist/esm/McUpload/comps/McUploadCmp/index.less +0 -68
- package/dist/esm/McUpload/comps/McUploadDragger/index.d.ts +0 -49
- package/dist/esm/McUpload/comps/McUploadDragger/index.js +0 -264
- package/dist/esm/McUpload/comps/McUploadTrigger/index.d.ts +0 -39
- package/dist/esm/McUpload/comps/McUploadTrigger/index.js +0 -318
- package/dist/esm/McUpload/comps/McUploadTrigger/index.less +0 -204
- package/dist/esm/McUpload/index.d.ts +0 -14
- package/dist/esm/McUpload/index.js +0 -9
- package/dist/esm/McUpload/tools/calculateMD5/index.d.ts +0 -3
- package/dist/esm/McUpload/tools/calculateMD5/index.js +0 -97
- package/dist/esm/McUpload/tools/calculateMD5/md5Worker.js +0 -46
- package/dist/esm/McUpload/tools/getUid.d.ts +0 -1
- package/dist/esm/McUpload/tools/getUid.js +0 -6
- package/dist/esm/McUpload/tools/materialVerification.d.ts +0 -50
- package/dist/esm/McUpload/tools/materialVerification.js +0 -257
- package/dist/esm/McUpload/tools/uploadTools.d.ts +0 -5
- package/dist/esm/McUpload/tools/uploadTools.js +0 -56
@@ -1,56 +0,0 @@
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
|
-
// web workers 如果说是cpu密集型任务,一般开启不超过10个,低于cpu2核,给用户的其他程序留出空间,
|
4
|
-
// 如果是io密集型任务,一般开启2-4个或低于cpu核心数一半,因为io密集型任务会大量阻塞,开启太多反而会降低性能
|
5
|
-
|
6
|
-
import { isNumber } from "./materialVerification";
|
7
|
-
|
8
|
-
// 统计方法执行时长
|
9
|
-
export function measureExecutionTime(fn) {
|
10
|
-
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
11
|
-
var start,
|
12
|
-
result,
|
13
|
-
end,
|
14
|
-
duration,
|
15
|
-
_args = arguments;
|
16
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
17
|
-
while (1) switch (_context.prev = _context.next) {
|
18
|
-
case 0:
|
19
|
-
start = Date.now();
|
20
|
-
_context.prev = 1;
|
21
|
-
_context.next = 4;
|
22
|
-
return fn.apply(void 0, _args);
|
23
|
-
case 4:
|
24
|
-
result = _context.sent;
|
25
|
-
_context.next = 10;
|
26
|
-
break;
|
27
|
-
case 7:
|
28
|
-
_context.prev = 7;
|
29
|
-
_context.t0 = _context["catch"](1);
|
30
|
-
// 如果函数抛出错误,将其捕获并存储在 result 中
|
31
|
-
result = _context.t0;
|
32
|
-
case 10:
|
33
|
-
end = Date.now();
|
34
|
-
duration = end - start; // 转换为毫秒
|
35
|
-
// 返回执行时间和函数结果
|
36
|
-
return _context.abrupt("return", {
|
37
|
-
duration: duration,
|
38
|
-
result: result
|
39
|
-
});
|
40
|
-
case 13:
|
41
|
-
case "end":
|
42
|
-
return _context.stop();
|
43
|
-
}
|
44
|
-
}, _callee, null, [[1, 7]]);
|
45
|
-
}));
|
46
|
-
}
|
47
|
-
export var transformNumber = function transformNumber(num) {
|
48
|
-
if (!isNumber(num)) {
|
49
|
-
var tempNum = Number(num);
|
50
|
-
if (isNumber(tempNum)) {
|
51
|
-
return tempNum;
|
52
|
-
}
|
53
|
-
return 0;
|
54
|
-
}
|
55
|
-
return num;
|
56
|
-
};
|