From c6f5717d2b6e32b79010d2504890ca1b098fee63 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Tue, 18 Apr 2017 10:01:21 -0700 Subject: [PATCH] packager: ResolutionRequest: stronger option typing Reviewed By: cpojer Differential Revision: D4906382 fbshipit-source-id: 1696c3e7fe07c84a3a497740dc87a237d9b71d1e --- .../src/ModuleGraph/node-haste/node-haste.js | 1 - .../DependencyGraph/ResolutionRequest.js | 26 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packager/src/ModuleGraph/node-haste/node-haste.js b/packager/src/ModuleGraph/node-haste/node-haste.js index 7f9b70058..c3a136727 100644 --- a/packager/src/ModuleGraph/node-haste/node-haste.js +++ b/packager/src/ModuleGraph/node-haste/node-haste.js @@ -112,7 +112,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn { entryPath: '', extraNodeModules, hasteFS, - hasteMap, helpers, matchFiles: filesByDirNameIndex.match.bind(filesByDirNameIndex), moduleCache, diff --git a/packager/src/node-haste/DependencyGraph/ResolutionRequest.js b/packager/src/node-haste/DependencyGraph/ResolutionRequest.js index 4d1b810bb..eca28e640 100644 --- a/packager/src/node-haste/DependencyGraph/ResolutionRequest.js +++ b/packager/src/node-haste/DependencyGraph/ResolutionRequest.js @@ -59,19 +59,19 @@ type ModuleishCache = { type MatchFilesByDirAndPattern = (dirName: string, pattern: RegExp) => Array; -type Options = { - dirExists: DirExistsFn, - entryPath: string, - extraNodeModules: ?Object, - hasteFS: HasteFS, - helpers: DependencyGraphHelpers, - matchFiles: MatchFilesByDirAndPattern, - moduleCache: ModuleishCache, - moduleMap: ModuleMap, - platform: string, - platforms: Set, - preferNativePlatform: boolean, -}; +type Options = {| + +dirExists: DirExistsFn, + +entryPath: string, + +extraNodeModules: ?Object, + +hasteFS: HasteFS, + +helpers: DependencyGraphHelpers, + +matchFiles: MatchFilesByDirAndPattern, + +moduleCache: ModuleishCache, + +moduleMap: ModuleMap, + +platform: string, + +platforms: Set, + +preferNativePlatform: boolean, +|}; /** * It may not be a great pattern to leverage exception just for "trying" things