Skip to content

Commit ddbfb7b

Browse files
committed
refactor
1 parent d0545ff commit ddbfb7b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/compiler/sys.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,14 @@ namespace ts {
495495
visitDirectory(path);
496496
return result;
497497
function visitDirectory(path: string) {
498-
// This filtering is necessary because on some file system node fails to exclude
499-
// "." and "..". See https://github.com/nodejs/node/issues/4002
500-
const files = filter(<string[]>_fs.readdirSync(path || "."), f => f !== "." && f !== "..").sort();
498+
const files = _fs.readdirSync(path || ".").sort();
501499
const directories: string[] = [];
502500
for (const current of files) {
501+
// This is necessary because on some file system node fails to exclude
502+
// "." and "..". See https://github.com/nodejs/node/issues/4002
503+
if (current === "." || current === "..") {
504+
continue;
505+
}
503506
const name = combinePaths(path, current);
504507
if (!contains(exclude, getCanonicalPath(name))) {
505508
const stat = _fs.statSync(name);

0 commit comments

Comments
 (0)