Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit c680717

Browse files
filter for watcher was mapping absolute paths to basenames
1 parent 480c654 commit c680717

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎plugins/PlatformFSPlugin.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@ export function mapFileSystem(args: MapFileSystemArgs): any {
112112
return mappedFiles;
113113
}
114114

115-
115+
/**
116+
* Maps and filters the input files.
117+
* Expects array with absolute paths.
118+
* Returns array with absolute paths.
119+
*/
116120
function filterAlienFilesAndMap(files: string[]): string[] {
117121
const mappedFiles = files
118122
.filter(isNotIgnored)
119123
.filter(isNotAlienPlatformFile)
120-
.map(trimPlatformSuffix)
121-
.map(file => basename(file));
124+
.map(trimPlatformSuffix);
122125
const uniqueMappedFiles = Array.from(new Set(mappedFiles));
123126
return uniqueMappedFiles;
124127
}
@@ -219,8 +222,9 @@ export function mapFileSystem(args: MapFileSystemArgs): any {
219222
} else {
220223
// Create absolute paths for "ignored" testing, map platforms, and return back the base name.
221224
const absoluteFilePaths = files.map(file => join(dir, file));
222-
const result = filterAlienFilesAndMap(absoluteFilePaths);
223-
callback(null, result);
225+
const resultAbsolute = filterAlienFilesAndMap(absoluteFilePaths);
226+
const resultFileNames = resultAbsolute.map(f => basename(f));
227+
callback(null, resultFileNames);
224228
}
225229
}
226230
base.apply(fs, arguments);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /