Skip to content

Commit

Permalink
fix(index): respect the value of boolean options (#498)
Browse files Browse the repository at this point in the history
* fix(index): respect the value of boolean options

* style(index): use shorter syntax

---------

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
multics and Fdawgs committed May 13, 2023
1 parent 6047885 commit e736e3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e736e3e

Please sign in to comment.