@abtnode/util 1.8.64 → 1.8.65-beta-5405baf2
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,11 +1,16 @@
|
|
|
1
|
+
const toLower = require('lodash/toLower');
|
|
2
|
+
|
|
1
3
|
const WILDCARD = '*';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* check two domains match or not. e.g. *.arcblock.io matches www.arcblock.io
|
|
5
|
-
* @param {String}
|
|
6
|
-
* @param {String}
|
|
7
|
+
* @param {String} domainX
|
|
8
|
+
* @param {String} domainY
|
|
7
9
|
*/
|
|
8
|
-
const checkDomainMatch = (
|
|
10
|
+
const checkDomainMatch = (domainX, domainY) => {
|
|
11
|
+
const domain1 = toLower(domainX);
|
|
12
|
+
const domain2 = toLower(domainY);
|
|
13
|
+
|
|
9
14
|
if (!domain1 || !domain2) return false;
|
|
10
15
|
if (typeof domain1 !== 'string' || typeof domain2 !== 'string') return false;
|
|
11
16
|
if (domain1 === domain2) return true;
|
|
@@ -30,6 +30,11 @@ const evaluateURL = async (url, options = {}) => {
|
|
|
30
30
|
// 子层越多越靠后
|
|
31
31
|
score -= hostname.split('.').length;
|
|
32
32
|
} else {
|
|
33
|
+
// 优先级高于 ip echo 地址
|
|
34
|
+
if (isDidDomain(hostname)) {
|
|
35
|
+
score += 21;
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
// ip echo, +20
|
|
34
39
|
if (isIpEcho(hostname)) {
|
|
35
40
|
score += 20;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.65-beta-5405baf2",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.8.
|
|
22
|
-
"@abtnode/logger": "1.8.
|
|
21
|
+
"@abtnode/constant": "1.8.65-beta-5405baf2",
|
|
22
|
+
"@abtnode/logger": "1.8.65-beta-5405baf2",
|
|
23
23
|
"@arcblock/jwt": "^1.18.37",
|
|
24
|
-
"@blocklet/constant": "1.8.
|
|
24
|
+
"@blocklet/constant": "1.8.65-beta-5405baf2",
|
|
25
25
|
"@ocap/mcrypto": "1.18.37",
|
|
26
26
|
"@ocap/util": "1.18.37",
|
|
27
27
|
"@ocap/wallet": "1.18.37",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"jest": "^27.5.1",
|
|
71
71
|
"unzipper": "^0.10.11"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e5dc838baded7031096118462a604fd70d78ff1c"
|
|
74
74
|
}
|