From 50037cf1da9638bad6d31702296001df0a4f21e4 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 17 Sep 2022 07:44:02 -0400 Subject: [PATCH] dns: remove unnecessary parameter from validateOneOf PR-URL: https://github.com/nodejs/node/pull/44635 Reviewed-By: Kohei Ueno Reviewed-By: Matteo Collina Reviewed-By: Daeyeon Jeong Reviewed-By: Luigi Pinca Reviewed-By: LiviaMedeiros Reviewed-By: Akhil Marsonya --- lib/dns.js | 4 ++-- lib/internal/dns/promises.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index 3a334b81edcd0f..0f66b184d48a51 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -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; } diff --git a/lib/internal/dns/promises.js b/lib/internal/dns/promises.js index a94f4c893530e5..78777752c999e2 100644 --- a/lib/internal/dns/promises.js +++ b/lib/internal/dns/promises.js @@ -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) {