@tryghost/domain-validator 1.5.1 → 1.6.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.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/bin/dv.js +0 -0
- package/lib/request.js +9 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
package/bin/dv.js
CHANGED
|
File without changes
|
package/lib/request.js
CHANGED
|
@@ -10,6 +10,8 @@ const https = require('https');
|
|
|
10
10
|
const {Resolver} = require('dns').promises;
|
|
11
11
|
const resolver = new Resolver();
|
|
12
12
|
resolver.setServers(['1.1.1.1', '1.0.0.1']);
|
|
13
|
+
const semverMajor = require('semver/functions/major');
|
|
14
|
+
const nodeVersion = semverMajor(process.versions.node);
|
|
13
15
|
|
|
14
16
|
const staticLookup = () => async (hostname, _options, callback) => {
|
|
15
17
|
try {
|
|
@@ -19,7 +21,13 @@ const staticLookup = () => async (hostname, _options, callback) => {
|
|
|
19
21
|
return callback(new Error(`Unable to resolve ${hostname}`));
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
if (nodeVersion >= 20) {
|
|
25
|
+
// Node 20+ uses a different callback signature
|
|
26
|
+
callback(null, [{address: ips[0], family: 4}]);
|
|
27
|
+
} else {
|
|
28
|
+
// Node 18 and below use the old callback signature
|
|
29
|
+
callback(null, ips[0], 4);
|
|
30
|
+
}
|
|
23
31
|
} catch (err) {
|
|
24
32
|
return callback(err);
|
|
25
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/domain-validator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "ssh://git@github.com/TryGhost/Pro",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@tryghost/debug": "0.1.17",
|
|
34
|
-
"@tryghost/dns": "^0.5.
|
|
34
|
+
"@tryghost/dns": "^0.5.1",
|
|
35
35
|
"@tryghost/errors": "1.2.14",
|
|
36
36
|
"@tryghost/pretty-cli": "1.2.9",
|
|
37
37
|
"bluebird": "3.7.2",
|
|
38
38
|
"got": "8.3.2",
|
|
39
39
|
"lodash": "4.17.21"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "3533c8bcfe1cc531fdc88955e3a8ce42ed7bc4fa"
|
|
42
42
|
}
|