packager: getAssetDataFromName: @flow

Reviewed By: davidaurelio

Differential Revision: D4921247

fbshipit-source-id: 47c516257cde5de6b69604d714e45310d00afe19
This commit is contained in:
Jean Lauliac
2017-04-20 07:35:15 -07:00
committed by Facebook Github Bot
parent 47f834a76d
commit 2403b42cf9
5 changed files with 29 additions and 14 deletions
@@ -46,12 +46,12 @@ const platforms = new Set(defaults.platforms);
*/
function getFakeModuleMap(hasteMap: HasteMap) {
return {
getModule(name: string, platform_: string): ?string {
const module = hasteMap.getModule(name, platform_);
getModule(name: string, platform: ?string): ?string {
const module = hasteMap.getModule(name, platform);
return module && module.type === 'Module' ? module.path : null;
},
getPackage(name: string, platform_: string): ?string {
const module = hasteMap.getModule(name, platform_);
getPackage(name: string, platform: ?string): ?string {
const module = hasteMap.getModule(name, platform);
return module && module.type === 'Package' ? module.path : null;
},
};