util-helpers 4.20.5 → 4.20.7
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/README.md +4 -2
- package/dist/util-helpers.js +12 -4
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/native.js +4 -2
- package/lib/VERSION.js +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/native.js +4 -2
- package/package.json +21 -24
package/README.md
CHANGED
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
npm install util-helpers
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
或者你使用 `yarn`
|
|
18
|
-
|
|
19
17
|
```shell
|
|
20
18
|
yarn add util-helpers
|
|
21
19
|
```
|
|
22
20
|
|
|
21
|
+
```shell
|
|
22
|
+
pnpm add util-helpers
|
|
23
|
+
```
|
|
24
|
+
|
|
23
25
|
### 浏览器引入
|
|
24
26
|
|
|
25
27
|
如果你的项目使用的是原生方式开发,可以在浏览器中使用 `script` 标签直接引入文件,并使用全局变量 `utilHelpers` 。
|
package/dist/util-helpers.js
CHANGED
|
@@ -133,6 +133,14 @@
|
|
|
133
133
|
return decimalAdjust('round', number, precision);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
function constant(value) {
|
|
137
|
+
return function () {
|
|
138
|
+
return value;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function noop() { }
|
|
143
|
+
|
|
136
144
|
function sleep(ms) {
|
|
137
145
|
if (ms === void 0) { ms = 1000; }
|
|
138
146
|
return new Promise(function (resolve) {
|
|
@@ -1285,8 +1293,8 @@
|
|
|
1285
1293
|
}
|
|
1286
1294
|
|
|
1287
1295
|
var objectKeys = Object.keys;
|
|
1288
|
-
var createObjectURL = URL.createObjectURL;
|
|
1289
|
-
var revokeObjectURL = URL.revokeObjectURL;
|
|
1296
|
+
var createObjectURL = typeof URL !== 'undefined' ? URL.createObjectURL : constant('');
|
|
1297
|
+
var revokeObjectURL = typeof URL !== 'undefined' ? URL.revokeObjectURL : noop;
|
|
1290
1298
|
|
|
1291
1299
|
function ajax(url, options) {
|
|
1292
1300
|
var _a = options || {}, _b = _a.method, method = _b === void 0 ? 'get' : _b, _c = _a.data, data = _c === void 0 ? null : _c, timeout = _a.timeout, headers = _a.headers, _d = _a.withCredentials, withCredentials = _d === void 0 ? false : _d, _e = _a.async, async = _e === void 0 ? true : _e, _f = _a.user, user = _f === void 0 ? null : _f, _g = _a.password, password = _g === void 0 ? null : _g, responseType = _a.responseType, onReadyStateChange = _a.onReadyStateChange, onLoadStart = _a.onLoadStart, onProgress = _a.onProgress, onAbort = _a.onAbort, onTimeout = _a.onTimeout, onError = _a.onError, onLoad = _a.onLoad, onLoadEnd = _a.onLoadEnd;
|
|
@@ -1976,9 +1984,9 @@
|
|
|
1976
1984
|
return internalFindTreeSelect(tree, predicate, childrenField);
|
|
1977
1985
|
}
|
|
1978
1986
|
|
|
1979
|
-
var VERSION = "4.20.
|
|
1987
|
+
var VERSION = "4.20.7";
|
|
1980
1988
|
|
|
1981
|
-
var version = "4.20.
|
|
1989
|
+
var version = "4.20.7";
|
|
1982
1990
|
|
|
1983
1991
|
exports.VERSION = VERSION;
|
|
1984
1992
|
exports.ajax = ajax;
|