Skip to content
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

Option to disable dotted notation #70

Open
git-developer opened this issue Jun 15, 2024 · 4 comments
Open

Option to disable dotted notation #70

git-developer opened this issue Jun 15, 2024 · 4 comments

Comments

@git-developer
Copy link
Contributor

Minimist supports a dotted notation that may be used to build an object tree from args:

$ node index.js --foo.bar=x
{ _: [], foo: { bar: 'x' } }

This issue is a request to allow a user to disable this feature, so that the above example is parsed as foo.bar: 'x' instead of foo: { bar: 'x' }.

Motivation: the dotted notation supports neither arrays nor keys containing a dot. That makes it hard to use minimist if any of these is used in the application.

Related: #67, #69

@ljharb
Copy link
Member

ljharb commented Jun 15, 2024

Why would a key ever contain a dot?

@git-developer
Copy link
Contributor Author

I just mentioned this for the sake of completeness. I don't know of any practical use case either.

@git-developer
Copy link
Contributor Author

The actual use case is to leave args untouched so that they can be post-processed using a different library that is able to build both objects and arrays (originally mentioned here).

@shadowspawn
Copy link
Collaborator

Somewhat related Minimist issues:

And related yargs-parser configuration:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants