aboutsummaryrefslogtreecommitdiff
path: root/lib/dns.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns.js')
-rw-r--r--lib/dns.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/dns.js b/lib/dns.js
index 8cfa7f58c5..e084fb5e5d 100644
--- a/lib/dns.js
+++ b/lib/dns.js
@@ -53,7 +53,7 @@ function errnoException(err, syscall, hostname) {
// callback.immediately = true;
// }
function makeAsync(callback) {
- if (!util.isFunction(callback)) {
+ if (typeof callback !== 'function') {
return callback;
}
return function asyncCallback() {
@@ -96,7 +96,7 @@ exports.lookup = function lookup(hostname, options, callback) {
family = 0;
} else if (typeof callback !== 'function') {
throw TypeError('invalid arguments: callback must be passed');
- } else if (util.isObject(options)) {
+ } else if (options !== null && typeof options === 'object') {
hints = options.hints >>> 0;
family = options.family >>> 0;
@@ -192,9 +192,9 @@ function resolver(bindingName) {
var binding = cares[bindingName];
return function query(name, callback) {
- if (!util.isString(name)) {
+ if (typeof name !== 'string') {
throw new Error('Name must be a string');
- } else if (!util.isFunction(callback)) {
+ } else if (typeof callback !== 'function') {
throw new Error('Callback must be a function');
}
@@ -228,17 +228,17 @@ exports.reverse = resolveMap.PTR = resolver('getHostByAddr');
exports.resolve = function(hostname, type_, callback_) {
var resolver, callback;
- if (util.isString(type_)) {
+ if (typeof type_ === 'string') {
resolver = resolveMap[type_];
callback = callback_;
- } else if (util.isFunction(type_)) {
+ } else if (typeof type_ === 'function') {
resolver = exports.resolve4;
callback = type_;
} else {
throw new Error('Type must be a string');
}
- if (util.isFunction(resolver)) {
+ if (typeof resolver === 'function') {
return resolver(hostname, callback);
} else {
throw new Error('Unknown type "' + type_ + '"');