@whitesev/utils 2.6.9 → 2.7.0

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.
@@ -56,7 +56,7 @@ declare class Utils {
56
56
  * ajax劫持库,支持xhr和fetch劫持。
57
57
  * + 来源:https://bbs.tampermonkey.net.cn/thread-3284-1-1.html
58
58
  * + 作者:cxxjackie
59
- * + 版本:1.4.4
59
+ * + 版本:1.4.6
60
60
  * + 旧版本:1.2.4
61
61
  * + 文档:https://scriptcat.org/zh-CN/script-show-page/637/
62
62
  * @param useOldVersion 是否使用旧版本,默认false
@@ -1,4 +1,4 @@
1
- export function AjaxHooker(): {
1
+ export function ajaxHooker(): {
2
2
  hook: (fn: any) => number;
3
3
  filter: (arr: any) => void;
4
4
  protect: () => void;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package.json",
2
3
  "name": "@whitesev/utils",
3
- "version": "2.6.9",
4
+ "version": "2.7.0",
5
+ "type": "module",
4
6
  "description": "一个常用的工具库",
5
- "$schema": "https://json.schemastore.org/package.json",
6
7
  "main": "dist/index.cjs.js",
7
8
  "module": "dist/index.esm.js",
8
9
  "types": "dist/types/index.d.ts",
@@ -34,16 +35,17 @@
34
35
  "author": "WhiteSev",
35
36
  "license": "MIT",
36
37
  "dependencies": {
37
- "@rollup/plugin-babel": "^6.0.4",
38
- "@rollup/plugin-commonjs": "^26.0.1",
39
- "@rollup/plugin-node-resolve": "^15.2.3",
40
- "@rollup/plugin-typescript": "^11.1.6",
41
- "rollup-plugin-clear": "^2.0.7",
42
- "tslib": "^2.6.3",
43
38
  "worker-timers": "^8.0.21"
44
39
  },
45
40
  "devDependencies": {
46
- "typescript": "^5.5.4"
41
+ "@rollup/plugin-babel": "^6.0.4",
42
+ "@rollup/plugin-commonjs": "^28.0.6",
43
+ "@rollup/plugin-node-resolve": "^16.0.1",
44
+ "@rollup/plugin-typescript": "^12.1.2",
45
+ "rollup": "^4.44.1",
46
+ "rollup-plugin-clear": "^2.0.7",
47
+ "tslib": "^2.8.1",
48
+ "typescript": "^5.8.3"
47
49
  },
48
50
  "scripts": {
49
51
  "dev": "rollup --config --watch",
package/src/Utils.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ColorConversion } from "./ColorConversion";
2
2
  import { GBKEncoder } from "./GBKEncoder";
3
3
  import { UtilsGMCookie } from "./UtilsGMCookie";
4
- import { AjaxHooker } from "./ajaxHooker/ajaxHooker.js";
4
+ import { ajaxHooker } from "./ajaxHooker/ajaxHooker.js";
5
5
  import { AjaxHooker1_2_4 } from "./ajaxHooker/ajaxHooker1.2.4";
6
6
  import { GMMenu } from "./UtilsGMMenu";
7
7
  import { Hooks } from "./Hooks";
@@ -39,7 +39,7 @@ class Utils {
39
39
  this.windowApi = new WindowApi(option);
40
40
  }
41
41
  /** 版本号 */
42
- version = "2025.6.7";
42
+ version = "2025.6.26";
43
43
  /**
44
44
  * 在页面中增加style元素,如果html节点存在子节点,添加子节点第一个,反之,添加到html节点的子节点最后一个
45
45
  * @param cssText css字符串
@@ -148,7 +148,7 @@ class Utils {
148
148
  * ajax劫持库,支持xhr和fetch劫持。
149
149
  * + 来源:https://bbs.tampermonkey.net.cn/thread-3284-1-1.html
150
150
  * + 作者:cxxjackie
151
- * + 版本:1.4.4
151
+ * + 版本:1.4.6
152
152
  * + 旧版本:1.2.4
153
153
  * + 文档:https://scriptcat.org/zh-CN/script-show-page/637/
154
154
  * @param useOldVersion 是否使用旧版本,默认false
@@ -157,7 +157,7 @@ class Utils {
157
157
  if (useOldVersion) {
158
158
  return AjaxHooker1_2_4();
159
159
  } else {
160
- return AjaxHooker();
160
+ return ajaxHooker();
161
161
  }
162
162
  };
163
163
  /**