Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch reload@3.3.0 for the project I'm working on.
The problem is that when calling the reload binary withour passing --browser, the browser is launched anyway.
The cause is the wrong parsing of options.browser field. When --browser is not passed, the field value is undefined. However, before passing this to reload() function, the value is casted to string, resulting in "undefined", and then double-negated (with !!) turning it into true.
The solution is to double-negate options.browser before converting it into a string.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
reload@3.3.0
for the project I'm working on.The problem is that when calling the
reload
binary withour passing--browser
, the browser is launched anyway.The cause is the wrong parsing of
options.browser
field. When--browser
is not passed, the field value isundefined
. However, before passing this toreload()
function, the value is casted to string, resulting in"undefined"
, and then double-negated (with!!
) turning it intotrue
.The solution is to double-negate
options.browser
before converting it into a string.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.