@tryghost/domain-validator 1.5.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2022 Ghost Foundation
3
+ Copyright (c) 2013-2025 Ghost Foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -18,4 +18,4 @@
18
18
 
19
19
  # Copyright & License
20
20
 
21
- Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
21
+ Copyright (c) 2013-2025 Ghost Foundation - Released under the [MIT license](LICENSE).
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
- callback(null, ips[0], 4);
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.5.2",
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.0",
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": "d66598b08a0088858aaf9e15a37dfa22d1872e26"
41
+ "gitHead": "3533c8bcfe1cc531fdc88955e3a8ce42ed7bc4fa"
42
42
  }