Skip to content

Fix duplicated result when using globstar#231

Merged
sindresorhus merged 2 commits intosindresorhus:mainfrom
jopemachine:fix-globstar-bug
Feb 2, 2022
Merged

Fix duplicated result when using globstar#231
sindresorhus merged 2 commits intosindresorhus:mainfrom
jopemachine:fix-globstar-bug

Conversation

@jopemachine
Copy link
Copy Markdown
Contributor

Fixes #175.

I updated createFilterFunction using normalized path string instead of just path.

So, the below code lines return the commented values instead of [ 'a/b', './a/b' ].

// below code returns [ './a/b' ]
console.log(globbySync(['./a/**', './a']));

// below code returns [ 'a/b' ]
console.log(globbySync(['./a', './a/**']));

@sindresorhus
Copy link
Copy Markdown
Owner

Can you add a test?

@jopemachine
Copy link
Copy Markdown
Contributor Author

jopemachine commented Feb 1, 2022

Can you add a test?

Sure, I just made a test about this. Would this test be enough to test this case?

@sindresorhus sindresorhus changed the title Fix globstar duplicated result bug Fix duplicated result when using globstar Feb 2, 2022
@sindresorhus sindresorhus merged commit f9d35ae into sindresorhus:main Feb 2, 2022
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.

Duplicated results when directory specified with globstar

2 participants