From e736e3e5a4e728233167516491925bb07fa79c19 Mon Sep 17 00:00:00 2001 From: Edward Date: Sun, 14 May 2023 01:09:33 +0800 Subject: [PATCH] fix(index): respect the value of boolean options (#498) * fix(index): respect the value of boolean options * style(index): use shorter syntax --------- Co-authored-by: Frazer Smith --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 2da5b740..aadf3343 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,10 @@ function parseOptions(acceptedOptions, options, version) { if (Object.prototype.hasOwnProperty.call(acceptedOptions, key)) { // eslint-disable-next-line valid-typeof if (typeof options[key] === acceptedOptions[key].type) { + // Skip boolean options if false + if (acceptedOptions[key].type === "boolean" && !options[key]) { + return; + } // Arg will be empty for some non-standard options if (acceptedOptions[key].arg !== "") { args.push(acceptedOptions[key].arg);