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

Negation in globbySync seems to miss files #237

Open
k2snowman69 opened this issue Oct 13, 2022 · 0 comments
Open

Negation in globbySync seems to miss files #237

k2snowman69 opened this issue Oct 13, 2022 · 0 comments

Comments

@k2snowman69
Copy link

k2snowman69 commented Oct 13, 2022

I can't seem to get globbySync to perform a proper negation glob. I'm fairly sure this is likely user error but I honestly can't wrap my head around it.

I created a repo with an app folder to run globby sync on - https://github.com/k2snowman69/issue-sortier-1763/tree/main/app
Then I created some tests to show a variety of tests - https://github.com/k2snowman69/issue-sortier-1763/blob/main/app/globby.test.js

Currently none of the negation tests succeed.

A good example of my confusion is the test "Negation first › pulls non-css or non-js files - curly" which runs const files = globbySync(`!**/*.{json,css}`);. This should match 3 files but unexpectedly I get 0 matches.

Further if I take this exact example to an online glob tester this same glob !**/*.{json,css} does seem to actually result in matching everything except for json or css files.

Do note that some of those negate unit tests are meant to fail... I was mostly just trying stuff to see if anything worked.

So any help here to understand why globbySync wouldn't return the correct negation result would be helpful, thanks!

In case it matters:

  • Node: v16.13.0
  • NPM: 7.12.1
  • OS: Windows 10
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

1 participant