sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Fix duplicated result when using globstar #231

Closed jopemachine closed 2 years ago

jopemachine commented 2 years ago

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 commented 2 years ago

Can you add a test?

jopemachine commented 2 years ago

Can you add a test?

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