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 <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
  • 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.