Skip to content

Commit

Permalink
dns: remove unnecessary parameter from validateOneOf
Browse files Browse the repository at this point in the history
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 31c19e3 commit 7e0b9e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/dns/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 7e0b9e1

Please sign in to comment.