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

Brace expansion matches single item #49

Closed
mojavelinux opened this issue Nov 19, 2019 · 3 comments
Closed

Brace expansion matches single item #49

mojavelinux opened this issue Nov 19, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@mojavelinux
Copy link
Contributor

According to the braces library, braces expansion should not match a single item like {foo}. However, picomatch does interpret this expression.

braces:

braces('{foo}')
//=> ['{foo}']

picomatch:

picomatch.parse('{foo}').output
//=> '(foo)'

Compare that to when there are multiple items:

braces('{foo,bar}')
//=> ['(foo|bar)']
picomatch.parse('{foo,bar}').output
//=> '(foo|bar)'

It seems to me like the behavior should match in both cases.

@mojavelinux mojavelinux changed the title Brace expression matches single item Brace expansion matches single item Nov 19, 2019
@mojavelinux
Copy link
Contributor Author

mojavelinux commented Nov 19, 2019

I also find this comment from the README confusing:

Picomatch does not do brace expansion.

Based on my observations, picomatch appears to support all sorts of brace expansion.

@jonschlinkert
Copy link
Member

Picomatch does not do brace expansion.

Brace expansion is not the same as brace matching.

Expansion does this: {a,b,c} => ['a', 'b', 'c'].

braces expansion should not match a single item like {foo}.

Agreed, this is a bug. Thanks for creating the issue.

@jonschlinkert jonschlinkert added the bug Something isn't working label Nov 26, 2019
@mojavelinux
Copy link
Contributor Author

Brace expansion is not the same as brace matching.

Aha! That makes sense. Thanks for clarifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants