-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow int arg to be 0 #49
Conversation
let propVal = value | ||
if (typeof option.defaultValue !== 'undefined' && typeof propVal !== typeof option.defaultValue) { | ||
propVal = option.defaultValue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add an empty line here?
value = fromArgs | ||
} | ||
} | ||
|
||
// Process the option's value | ||
for (let name of option.usage) { | ||
let propVal = value || option.defaultValue | ||
let propVal = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add an empty line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leo done 👍
Thanks a lot! |
* Allow int value to be 0 * Add emtpy lines
This should solve vercel/serve#57
Basically when passing a value of 0 to a integer arg, the value would be set to default
Before
node example.js --cache 0 # sets cache to default value
After
node example.js --cache 0 # sets cache to 0