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

feat: scanDirs respects input dirs order #148

Merged
merged 2 commits into from
Nov 15, 2022
Merged

Conversation

yassilah
Copy link
Contributor

Resolves #141.

@antfu antfu merged commit 25543d5 into unjs:main Nov 15, 2022
const result = await Promise.all(
// Do multiple glob searches to persist the order of input dirs
dirs.map(async i => await fg(
[i, ...filePatterns].map(p => join(i, p)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a mistake here, it should be [i, ...filePatterns.map(p => join(i, p))] instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in v1.0.1

})
.then(r => r
.map(f => normalize(f))
.filter(fileFilter)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think it's necessary to filter here since you're filtering after flattening the array

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.

scanDirs is not respecting the priority order of auto-imports
2 participants