Skip to content

Commit

Permalink
dns: remove unnecessary parameter from validateOneOf
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 Sep 17, 2022
1 parent ccd4c31 commit 572d556
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 572d556

Please sign in to comment.