@whitesev/utils 2.7.0 → 2.7.2

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.
Files changed (48) hide show
  1. package/README.md +19 -19
  2. package/dist/index.amd.js +205 -235
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.cjs.js +205 -235
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm.js +205 -235
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +205 -235
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +205 -235
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +205 -235
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/ColorConversion.d.ts +3 -8
  15. package/dist/types/src/Dictionary.d.ts +21 -14
  16. package/dist/types/src/GBKEncoder.d.ts +1 -2
  17. package/dist/types/src/Hooks.d.ts +1 -2
  18. package/dist/types/src/Httpx.d.ts +45 -46
  19. package/dist/types/src/LockFunction.d.ts +1 -2
  20. package/dist/types/src/Log.d.ts +1 -2
  21. package/dist/types/src/Progress.d.ts +1 -2
  22. package/dist/types/src/Utils.d.ts +1 -1
  23. package/dist/types/src/UtilsGMMenu.d.ts +1 -2
  24. package/dist/types/src/WindowApi.d.ts +1 -2
  25. package/dist/types/src/indexedDB.d.ts +1 -2
  26. package/dist/types/src/types/Httpx.d.ts +73 -67
  27. package/dist/types/src/types/env.d.ts +2 -0
  28. package/dist/types/src/types/global.d.ts +3 -0
  29. package/package.json +1 -1
  30. package/src/ColorConversion.ts +14 -25
  31. package/src/DOMUtils.ts +14 -16
  32. package/src/Dictionary.ts +39 -35
  33. package/src/GBKEncoder.ts +8 -12
  34. package/src/Hooks.ts +1 -3
  35. package/src/Httpx.ts +194 -174
  36. package/src/LockFunction.ts +3 -3
  37. package/src/Log.ts +1 -3
  38. package/src/Progress.ts +1 -3
  39. package/src/TryCatch.ts +4 -4
  40. package/src/Utils.ts +29 -45
  41. package/src/UtilsGMMenu.ts +19 -22
  42. package/src/Vue.ts +4 -7
  43. package/src/WindowApi.ts +2 -5
  44. package/src/ajaxHooker/ajaxHooker.js +35 -21
  45. package/src/indexedDB.ts +8 -8
  46. package/src/types/Httpx.d.ts +73 -67
  47. package/src/types/env.d.ts +2 -0
  48. package/src/types/global.d.ts +3 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 安装
2
2
 
3
- + 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/utils)](https://www.npmjs.com/package/@whitesev/utils)
3
+ - 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/utils)](https://www.npmjs.com/package/@whitesev/utils)
4
4
 
5
5
  ```node
6
6
  npm install @whitesev/utils
@@ -37,8 +37,8 @@ Utils.assign({1:1},{1:2,2:3})
37
37
 
38
38
  ```javascript
39
39
  /* 等待a元素出现,返回Promise对象,在then中或使用await获取结果,统一返回数组格式的元素,如[...a] */
40
- Utils.waitNode("a").then((element => {
41
- console.log(element );
40
+ Utils.waitNode("a").then((element) => {
41
+ console.log(element);
42
42
  });
43
43
 
44
44
  /* 同时满足多个选择器的结果,都满足了才会触发回调 */
@@ -61,24 +61,24 @@ Utils.toJSON("{123:123}");
61
61
  let httpx = new Utils.Httpx();
62
62
  /* 修改配置 */
63
63
  httpx.config({
64
- timeout: 5000,
65
- onabort: function () {
66
- console.log("请求取消");
67
- },
68
- ontimeout: function () {
69
- console.log("请求超时");
70
- },
71
- onerror: function (response) {
72
- console.log("httpx-onerror 请求异常");
73
- console.log(response);
74
- },
64
+ timeout: 5000,
65
+ onabort: function () {
66
+ console.log("请求取消");
67
+ },
68
+ ontimeout: function () {
69
+ console.log("请求超时");
70
+ },
71
+ onerror: function (response) {
72
+ console.log("httpx-onerror 请求异常");
73
+ console.log(response);
74
+ },
75
75
  });
76
76
  /* 发送post请求 */
77
77
  let postResp = await httpx.post({
78
- url: url,
79
- data: JSON.stringify({
80
- test: 1,
81
- }),
78
+ url: url,
79
+ data: JSON.stringify({
80
+ test: 1,
81
+ }),
82
82
  });
83
83
  ```
84
84
 
@@ -173,4 +173,4 @@ menu_key:{
173
173
  GM_Menu.delete("menu_key");
174
174
  ```
175
175
 
176
- 等...API请看代码
176
+ 等...API 请看文档