Skip to content
Permalink
Browse files
dns: remove unnecessary parameter from validateOneOf
PR-URL: #44635
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
  • Loading branch information
anonrig authored and RafaelGSS committed Sep 26, 2022
1 parent b209c83 commit 4686579d4be9e01c3981267160c10e31b15676c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -154,7 +154,7 @@ function lookup(hostname, options, callback) {
} else if (typeof options === 'number') {
validateFunction(callback, 'callback');

validateOneOf(options, 'family', validFamilies, true);
validateOneOf(options, 'family', validFamilies);
family = options;
} else if (options !== undefined && typeof options !== 'object') {
validateFunction(arguments.length === 2 ? options : callback, 'callback');
@@ -176,7 +176,7 @@ function lookup(hostname, options, callback) {
family = 6;
break;
default:
validateOneOf(options.family, 'options.family', validFamilies, true);
validateOneOf(options.family, 'options.family', validFamilies);
family = options.family;
break;
}
@@ -166,7 +166,7 @@ function lookup(hostname, options) {
}

if (typeof options === 'number') {
validateOneOf(options, 'family', validFamilies, true);
validateOneOf(options, 'family', validFamilies);
family = options;
} else if (options !== undefined && typeof options !== 'object') {
throw new ERR_INVALID_ARG_TYPE('options', ['integer', 'object'], options);
@@ -177,7 +177,7 @@ function lookup(hostname, options) {
validateHints(hints);
}
if (options?.family != null) {
validateOneOf(options.family, 'options.family', validFamilies, true);
validateOneOf(options.family, 'options.family', validFamilies);
family = options.family;
}
if (options?.all != null) {

0 comments on commit 4686579

Please sign in to comment.