Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
platform = options.platform;
const files = Object.keys(transformedFiles);
function getTransformedFile(path) {
const result = transformedFiles[path];
if (!result) {
throw new Error(`"${path} does not exist`);
}
return result;
}
const helpers = new DependencyGraphHelpers({
assetExts,
providesModuleNodeModules: defaults.providesModuleNodeModules
});
const hasteFS = new HasteFS(files);
const moduleCache = new ModuleCache(
filePath => hasteFS.closest(filePath, "package.json"),
getTransformedFile
);
const filesByDirNameIndex = new FilesByDirNameIndex(files);
const assetResolutionCache = new AssetResolutionCache({
assetExtensions: new Set(assetExts),
getDirFiles: dirPath => filesByDirNameIndex.getAllFiles(dirPath),
platforms
});
const moduleResolver = new ModuleResolver({
allowPnp,
dirExists: filePath => hasteFS.dirExists(filePath),
doesFileExist: filePath => hasteFS.exists(filePath),