Use the "withFileTypes" options with fs.readdir().#14994
Conversation
kimadeline
left a comment
There was a problem hiding this comment.
Do we have any tests that need to be updated as part of this PR?
| export function listDir(dirname: string): Promise<string[]> { | ||
| return fsapi.readdir(dirname); | ||
| export function listDir(dirname: string): Promise<fs.Dirent[]> { | ||
| return fs.promises.readdir(dirname, { withFileTypes: true }); |
There was a problem hiding this comment.
Just wanted to point out that the assumption is that passing this option does not make things any more expensive than it previous was.
There was a problem hiding this comment.
It makes it cheaper, in fact. 😄
kimadeline
left a comment
There was a problem hiding this comment.
My comments above are not blocking.
|
There aren't any tests already for |
2483ede to
27ac913
Compare
src/test/pythonEnvironments/common/commonUtils.functional.test.ts
Outdated
Show resolved
Hide resolved
| matched = cfg.filterFile(filename); | ||
| } catch (err) { | ||
| if (cfg.ignoreErrors) { | ||
| logError(`filterFile() failed for "${filename}" (${err})`); |
There was a problem hiding this comment.
I was expecting us to continue here instead of return.
There was a problem hiding this comment.
Also, I expect to ignore errors and continue by default.
Codecov Report
@@ Coverage Diff @@
## main #14994 +/- ##
=======================================
Coverage 65% 65%
=======================================
Files 557 560 +3
Lines 26215 26358 +143
Branches 3727 3745 +18
=======================================
+ Hits 17060 17160 +100
- Misses 8459 8501 +42
- Partials 696 697 +1
|
For #14983.
[ ] Has a news entry file (remember to thank yourself!).[ ] Has telemetry for enhancements.[ ] Unit tests & system/integration tests are added/updated.[ ] Test plan is updated as appropriate.[ ]package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed).[ ] The wiki is updated with any design decisions/details.