xctc-utils 1.6.71 → 1.6.72

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.
@@ -1 +1 @@
1
- export declare function autoUpdateLastVersion(): void;
1
+ export declare function autoUpdateLastVersion(duration?: number): void;
@@ -32,7 +32,7 @@ async function needUpdate() {
32
32
  autoUpdateLastSrcs = newScripts;
33
33
  return result;
34
34
  }
35
- const autoUpdateDuration = 5000;
35
+ let autoUpdateDuration = 5000;
36
36
  function autoRefresh() {
37
37
  setTimeout(async () => {
38
38
  const willUpdate = await needUpdate();
@@ -42,7 +42,10 @@ function autoRefresh() {
42
42
  autoRefresh();
43
43
  }, autoUpdateDuration);
44
44
  }
45
- function autoUpdateLastVersion() {
45
+ function autoUpdateLastVersion(duration) {
46
+ if (duration && Number(duration) >= 2000) {
47
+ autoUpdateDuration = duration;
48
+ }
46
49
  autoRefresh();
47
50
  }
48
51
  exports.autoUpdateLastVersion = autoUpdateLastVersion;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xctc-utils",
3
3
  "private": false,
4
- "version": "1.6.71",
4
+ "version": "1.6.72",
5
5
  "description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",