util-helpers 4.22.0 → 4.22.1
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/util-helpers.js +9 -3
- 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/AsyncMemo.js +2 -2
- package/esm/VERSION.js +1 -1
- package/esm/index.js +1 -1
- package/lib/AsyncMemo.js +1 -1
- package/lib/VERSION.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/types/AsyncMemo.d.ts +0 -1
package/esm/AsyncMemo.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
2
|
import { Cache } from 'cache2';
|
|
3
|
-
import { isString } from 'ut2';
|
|
3
|
+
import { isString, uniqueId } from 'ut2';
|
|
4
4
|
|
|
5
5
|
var AsyncMemo = (function () {
|
|
6
6
|
function AsyncMemo(options) {
|
|
7
7
|
this.promiseCache = {};
|
|
8
|
-
this.cache = new Cache('uh_async_memo', options);
|
|
8
|
+
this.cache = new Cache(uniqueId('uh_async_memo'), options);
|
|
9
9
|
}
|
|
10
10
|
AsyncMemo.prototype.run = function (asyncFn, key, options) {
|
|
11
11
|
var _this = this;
|
package/esm/VERSION.js
CHANGED
package/esm/index.js
CHANGED
package/lib/AsyncMemo.js
CHANGED
|
@@ -7,7 +7,7 @@ var ut2 = require('ut2');
|
|
|
7
7
|
var AsyncMemo = (function () {
|
|
8
8
|
function AsyncMemo(options) {
|
|
9
9
|
this.promiseCache = {};
|
|
10
|
-
this.cache = new cache2.Cache('uh_async_memo', options);
|
|
10
|
+
this.cache = new cache2.Cache(ut2.uniqueId('uh_async_memo'), options);
|
|
11
11
|
}
|
|
12
12
|
AsyncMemo.prototype.run = function (asyncFn, key, options) {
|
|
13
13
|
var _this = this;
|
package/lib/VERSION.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -67,7 +67,7 @@ var config = require('./utils/config.js');
|
|
|
67
67
|
var VERSION = require('./VERSION.js');
|
|
68
68
|
var AsyncMemo = require('./AsyncMemo.js');
|
|
69
69
|
|
|
70
|
-
exports.version = "4.22.
|
|
70
|
+
exports.version = "4.22.1";
|
|
71
71
|
|
|
72
72
|
exports.isMobile = isMobile;
|
|
73
73
|
exports.isTelephone = isTelephone;
|
package/package.json
CHANGED
package/types/AsyncMemo.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { Cache, CacheOptions } from 'cache2';
|
|
|
7
7
|
* @param {Object} [options] 缓存配置项,更多配置项可参考 [`cache2`](https://www.npmjs.com/package/cache2)
|
|
8
8
|
* @param {number} [options.max] 最大缓存数量
|
|
9
9
|
* @param {'replaced' | 'limited'} [options.maxStrategy] 缓存策略
|
|
10
|
-
* @param {string} [options.prefix] 缓存键前缀
|
|
11
10
|
*/
|
|
12
11
|
declare class AsyncMemo<DataType = any> {
|
|
13
12
|
private promiseCache;
|