mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Adapt interface of node-haste duplicates
Summary: Adapts mocked / duplicated functionality from `node-haste` to match the new synchronous return types in the original. Reviewed By: jeanlauliac Differential Revision: D4819137 fbshipit-source-id: 183316adc3fae161ad9999bf72bccb8218ef8941
This commit is contained in:
committed by
Facebook Github Bot
parent
0ec984e69a
commit
a51e9a0704
@@ -63,10 +63,13 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn {
|
||||
transformedFiles,
|
||||
} = options;
|
||||
const files = Object.keys(transformedFiles);
|
||||
const getTransformedFile =
|
||||
path => Promise.resolve(
|
||||
transformedFiles[path] || Promise.reject(new Error(`"${path} does not exist`))
|
||||
);
|
||||
function getTransformedFile(path) {
|
||||
const result = transformedFiles[path];
|
||||
if (!result) {
|
||||
throw new Error(`"${path} does not exist`);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const helpers = new DependencyGraphHelpers({
|
||||
assetExts,
|
||||
|
||||
Reference in New Issue
Block a user