Fix a bunch of flow annotations

Reviewed By: jeanlauliac

Differential Revision: D4611846

fbshipit-source-id: c2fe468e34a3b1eba7fcd2596020aad136285363
This commit is contained in:
Christoph Pojer
2017-02-24 11:13:10 -08:00
committed by Facebook Github Bot
parent 843ad50296
commit 2a3fe0625d
10 changed files with 83 additions and 41 deletions

View File

@@ -48,6 +48,12 @@ module.exports = class HasteFS {
return Array.from(this.files.keys());
}
matchFiles() {
throw new Error(
'HasteFS.matchFiles is not implemented yet.'
);
}
matches(directory: string, pattern: RegExp) {
const entries = this.directoryEntries.get(directory);
return entries ? entries.filter(pattern.test, pattern) : [];

View File

@@ -78,7 +78,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn {
dirExists: filePath => hasteFS.dirExists(filePath),
entryPath: '',
extraNodeModules,
/* $FlowFixMe: object is missing matchFiles method */
hasteFS,
hasteMap,
helpers,