Fix support for haste packages

Summary: Fixes support for haste packages in `ModuleGraph`. As `HasteMap` is no longer used for anything else, we can probably strip it down completely.

Reviewed By: cpojer

Differential Revision: D4967367

fbshipit-source-id: d40cbe46c1e8b05690c0a2c71955479c28607c01
This commit is contained in:
David Aurelio
2017-04-28 17:01:18 -07:00
committed by Facebook Github Bot
parent 8fe24da6c2
commit a26e042784
2 changed files with 20 additions and 10 deletions
@@ -51,8 +51,8 @@ function getFakeModuleMap(hasteMap: HasteMap) {
return module && module.type === 'Module' ? module.path : null;
},
getPackage(name: string, platform: ?string): ?string {
const module = hasteMap.getModule(name, platform);
return module && module.type === 'Package' ? module.path : null;
const pkg = hasteMap.getPackage(name);
return pkg && pkg.path;
},
};
}