8000 [BUG] --no-[parameterName] doesn't allow setting to null for some typeDefs · Issue #79 · npm/nopt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[BUG] --no-[parameterName] doesn't allow setting to null for some typeDefs #79
@speige

Description

@speige

The purpose of "--no-myParam" is to allow setting a parameter to null instead of undefined, because "-myParam null" would set it to the string value 'null' instead of the javascript value null.

However, this feature is buggy for some typeDefs.

if typeDef is String
"--no-myParam" the parse() function sets it to false instead of null
However, clean() internally calls validateString() which changes it to 'false'

so, "--no-myParam" has no purpose in the case of typeDef String because i could have used "-myParam false" instead.

I haven't tested to see if the other typeDefs have similar issues, but it's possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0