From d235e0063600806470dd6f551d629a6b41fd6211 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Wed, 14 Sep 2022 09:24:39 -0400 Subject: [PATCH] dns: remove unnecessary parameter from validateOneOf --- 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) {