Skip to content
Prev Previous commit
Next Next commit
removed references to net module
  • Loading branch information
benjamingr committed Mar 17, 2016
commit 457de39ca7279a29e725abdf33c7ebb2c9e26d05
8 changes: 5 additions & 3 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ exports.lookup = function lookup(hostname, options, callback) {
family = options >>> 0;
}

if (family !== 0 && family !== 4 && family !== 6)
throw new TypeError('Invalid argument: family must be 4 or 6');
if (family !== 0 && family !== 4 && family !== 6) {
const msg = `Invalid argument: family must be 4 or 6, got {family}`;
throw new TypeError(msg);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the $ for the template string went missing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)


callback = makeAsync(callback);

Expand All @@ -155,7 +157,7 @@ exports.lookup = function lookup(hostname, options, callback) {
return {};
}

var matchedFamily = net.isIP(hostname);
var matchedFamily = isIP(hostname);
if (matchedFamily) {
if (all) {
callback(null, [{address: hostname, family: matchedFamily}]);
Expand Down