qmwts 1.1.22 → 1.1.23
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.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/utils/file-utils.d.ts +4 -0
- package/dist/utils/file-utils.js +14 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import JsonUtils from './utils/json-utils';
|
|
|
3
3
|
import UUIDUtils from './utils/uuid-utils';
|
|
4
4
|
import PrototypeUtils from './utils/prototype-utils';
|
|
5
5
|
import RequestDataGenerator from './utils/request-data-generator';
|
|
6
|
-
|
|
6
|
+
import FileUtils from './utils/file-utils';
|
|
7
|
+
export { NumberUtils, JsonUtils, UUIDUtils, PrototypeUtils, RequestDataGenerator, FileUtils, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestDataGenerator = exports.PrototypeUtils = exports.UUIDUtils = exports.JsonUtils = exports.NumberUtils = void 0;
|
|
3
|
+
exports.FileUtils = exports.RequestDataGenerator = exports.PrototypeUtils = exports.UUIDUtils = exports.JsonUtils = exports.NumberUtils = void 0;
|
|
4
4
|
// https://www.jianshu.com/p/8fa2c50720e4
|
|
5
5
|
var number_utils_1 = require("./utils/number-utils");
|
|
6
6
|
exports.NumberUtils = number_utils_1.default;
|
|
@@ -12,3 +12,5 @@ var prototype_utils_1 = require("./utils/prototype-utils");
|
|
|
12
12
|
exports.PrototypeUtils = prototype_utils_1.default;
|
|
13
13
|
var request_data_generator_1 = require("./utils/request-data-generator");
|
|
14
14
|
exports.RequestDataGenerator = request_data_generator_1.default;
|
|
15
|
+
var file_utils_1 = require("./utils/file-utils");
|
|
16
|
+
exports.FileUtils = file_utils_1.default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
formatSize: function (size) {
|
|
5
|
+
var units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
6
|
+
var index = 0;
|
|
7
|
+
var s = size;
|
|
8
|
+
while (s >= 1024 && index < units.length - 1) {
|
|
9
|
+
index++;
|
|
10
|
+
s = s / 1024;
|
|
11
|
+
}
|
|
12
|
+
return s.toFixed(1) + units[index];
|
|
13
|
+
}
|
|
14
|
+
};
|