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

[New] Support for arrays in dotted notation (--a[1].b) #68

Conversation

git-developer
Copy link
Contributor

I'd like to suggest a feature that seems to be missing: Support for arrays in dotted notation.

Let me explain the feature request using this simple example:

$ echo "console.log(require('minimist')(['--foo[0].bar=x', '--foo[2].bar=42']))" | node

Actual behavior

{ _: [], 'foo[0]': { bar: 'x' }, 'foo[2]': { bar: 42 } }

Desired behavior

{ _: [], foo: [ { bar: 'x' }, <1 empty item>, { bar: 42 } ] }

Motivation

#66 is a request for the same feature using a different syntax foo.0.bar. That syntax may be used to reference an array and may be implemented using a one-liner, but is unusual. This PR adapts to the well-known square bracket syntax and allows to discuss each idea on its own.

@git-developer
Copy link
Contributor Author

Closed due to comment.

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

Successfully merging this pull request may close these issues.

1 participant