@abtnode/util 1.16.52-beta-20250928-042319-ff3f0e04 → 1.16.52-beta-20251002-030549-0f91dab2

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.
@@ -99,6 +99,19 @@ const evaluateURLs = async (urls, options = {}) => {
99
99
  return results.sort((a, b) => b.score - a.score);
100
100
  };
101
101
 
102
+ const getOriginUrl = (url) => {
103
+ if (!url) return '';
104
+
105
+ try {
106
+ const parsed = new URL(url);
107
+ // 移除查询参数
108
+ return parsed.origin;
109
+ } catch (error) {
110
+ // 如果解析失败,回退到简单的字符串处理
111
+ return url;
112
+ }
113
+ };
114
+
102
115
  module.exports = {
103
116
  isIpEcho,
104
117
  isDidDomain,
@@ -106,4 +119,5 @@ module.exports = {
106
119
  evaluateURL,
107
120
  evaluateURLs,
108
121
  isCustomDomain,
122
+ getOriginUrl,
109
123
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.52-beta-20250928-042319-ff3f0e04",
6
+ "version": "1.16.52-beta-20251002-030549-0f91dab2",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,19 +18,19 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.16.52-beta-20250928-042319-ff3f0e04",
22
- "@abtnode/db-cache": "1.16.52-beta-20250928-042319-ff3f0e04",
23
- "@arcblock/did": "1.24.0",
24
- "@arcblock/event-hub": "1.24.0",
21
+ "@abtnode/constant": "1.16.52-beta-20251002-030549-0f91dab2",
22
+ "@abtnode/db-cache": "1.16.52-beta-20251002-030549-0f91dab2",
23
+ "@arcblock/did": "1.25.6",
24
+ "@arcblock/event-hub": "1.25.6",
25
25
  "@arcblock/pm2": "^6.0.12",
26
- "@blocklet/constant": "1.16.52-beta-20250928-042319-ff3f0e04",
26
+ "@blocklet/constant": "1.16.52-beta-20251002-030549-0f91dab2",
27
27
  "@blocklet/error": "^0.2.5",
28
- "@blocklet/meta": "1.16.52-beta-20250928-042319-ff3f0e04",
29
- "@blocklet/xss": "^0.2.7",
30
- "@ocap/client": "1.24.0",
31
- "@ocap/mcrypto": "1.24.0",
32
- "@ocap/util": "1.24.0",
33
- "@ocap/wallet": "1.24.0",
28
+ "@blocklet/meta": "1.16.52-beta-20251002-030549-0f91dab2",
29
+ "@blocklet/xss": "^0.2.9",
30
+ "@ocap/client": "1.25.6",
31
+ "@ocap/mcrypto": "1.25.6",
32
+ "@ocap/util": "1.25.6",
33
+ "@ocap/wallet": "1.25.6",
34
34
  "archiver": "^7.0.1",
35
35
  "axios": "^1.7.9",
36
36
  "axios-mock-adapter": "^2.1.0",
@@ -91,5 +91,5 @@
91
91
  "fs-extra": "^11.2.0",
92
92
  "jest": "^29.7.0"
93
93
  },
94
- "gitHead": "2390501ff6e05cbf356f751ced062803e3562465"
94
+ "gitHead": "57e57e5edc99bfbb7e4591d682f1057ec05655a8"
95
95
  }