diff options
Diffstat (limited to 'src/js/node/dns.js')
-rw-r--r-- | src/js/node/dns.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/js/node/dns.js b/src/js/node/dns.js index bb59e702f..e82e6a4b5 100644 --- a/src/js/node/dns.js +++ b/src/js/node/dns.js @@ -19,15 +19,12 @@ function lookup(domain, options, callback) { options = { family: options }; } - const invalidDomainValues = [ - undefined, - false, - null, - "" - ]; - - if(Number.isNaN(domain) || invalidDomainValues.some(value => domain === value)) { - console.warn(`DeprecationWarning: The provided hostname "${String(domain)}" is not a valid hostname, and is supported in the dns module solely for compatibility.`); + if (domain !== domain || (typeof domain !== "number" && !domain)) { + console.warn( + `DeprecationWarning: The provided hostname "${String( + domain, + )}" is not a valid hostname, and is supported in the dns module solely for compatibility.`, + ); callback(null, null, 4); return; } |