util-helpers 4.20.5 → 4.20.6
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 +13 -6
- 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 +5 -8
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
|
@@ -81,10 +81,9 @@
|
|
|
81
81
|
return value == null ? '' : baseToString(value);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
var freeGlobalThis = typeof globalThis === 'object' && globalThis && globalThis.Object === Object && globalThis;
|
|
85
84
|
var freeGlobal = typeof global === 'object' && global && global.Object === Object && global;
|
|
86
85
|
var freeSelf = typeof self === 'object' && self && self.Object === Object && self;
|
|
87
|
-
var root =
|
|
86
|
+
var root = freeGlobal || freeSelf || Function('return this')() || {};
|
|
88
87
|
var root$1 = root;
|
|
89
88
|
|
|
90
89
|
var blobExisted = typeof Blob !== 'undefined';
|
|
@@ -133,6 +132,14 @@
|
|
|
133
132
|
return decimalAdjust('round', number, precision);
|
|
134
133
|
}
|
|
135
134
|
|
|
135
|
+
function constant(value) {
|
|
136
|
+
return function () {
|
|
137
|
+
return value;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function noop() { }
|
|
142
|
+
|
|
136
143
|
function sleep(ms) {
|
|
137
144
|
if (ms === void 0) { ms = 1000; }
|
|
138
145
|
return new Promise(function (resolve) {
|
|
@@ -1285,8 +1292,8 @@
|
|
|
1285
1292
|
}
|
|
1286
1293
|
|
|
1287
1294
|
var objectKeys = Object.keys;
|
|
1288
|
-
var createObjectURL = URL.createObjectURL;
|
|
1289
|
-
var revokeObjectURL = URL.revokeObjectURL;
|
|
1295
|
+
var createObjectURL = typeof URL !== 'undefined' ? URL.createObjectURL : constant('');
|
|
1296
|
+
var revokeObjectURL = typeof URL !== 'undefined' ? URL.revokeObjectURL : noop;
|
|
1290
1297
|
|
|
1291
1298
|
function ajax(url, options) {
|
|
1292
1299
|
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 +1983,9 @@
|
|
|
1976
1983
|
return internalFindTreeSelect(tree, predicate, childrenField);
|
|
1977
1984
|
}
|
|
1978
1985
|
|
|
1979
|
-
var VERSION = "4.20.
|
|
1986
|
+
var VERSION = "4.20.6";
|
|
1980
1987
|
|
|
1981
|
-
var version = "4.20.
|
|
1988
|
+
var version = "4.20.6";
|
|
1982
1989
|
|
|
1983
1990
|
exports.VERSION = VERSION;
|
|
1984
1991
|
exports.ajax = ajax;
|