Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ModuleCache = require("./ModuleCache");
const defaults = require("metro-config/src/defaults/defaults");
const parsePlatformFilePath = require("../../node-haste/lib/parsePlatformFilePath");
const path = require("path");
const _require = require("../../node-haste/DependencyGraph/ModuleResolution"),
ModuleResolver = _require.ModuleResolver;
const _require2 = require("jest-haste-map"),
ModuleMap = _require2.ModuleMap;
const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = "g";
const PACKAGE_JSON = path.sep + "package.json";
const NULL_MODULE = {
path: "/",
getPackage() {},
isHaste() {
throw new Error("not implemented");
},
getName() {
throw new Error("not implemented");
}
}; // This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
const ModuleCache = require("./ModuleCache");
const defaults = require("metro-config/src/defaults/defaults");
const parsePlatformFilePath = require("../../node-haste/lib/parsePlatformFilePath");
const path = require("path");
const _require = require("../../node-haste/DependencyGraph/ModuleResolution"),
ModuleResolver = _require.ModuleResolver;
const _require2 = require("jest-haste-map"),
ModuleMap = _require2.ModuleMap;
const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = "g";
const PACKAGE_JSON = path.sep + "package.json";
const NULL_MODULE = {
path: "/",
getPackage() {},
isHaste() {
throw new Error("not implemented");
},
getName() {
throw new Error("not implemented");
}
}; // This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
import type {Moduleish} from '../../node-haste/DependencyGraph/ResolutionRequest';
import type {ResolveFn, TransformedCodeFile} from '../types.flow';
import type {Extensions, Path} from './node-haste.flow';
import type {CustomResolver} from 'metro-resolver';
type ResolveOptions = {|
assetExts: Extensions,
extraNodeModules: {[id: string]: string},
mainFields: $ReadOnlyArray,
resolveRequest?: ?CustomResolver,
+sourceExts: Extensions,
transformedFiles: {[path: Path]: TransformedCodeFile},
+platform: string,
|};
const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = 'g';
const PACKAGE_JSON = path.sep + 'package.json';
const NULL_MODULE: Moduleish = {
path: '/',
getPackage(): void {},
isHaste() {
throw new Error('not implemented');
},
getName() {
throw new Error('not implemented');
},
};
// This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
const createModuleMap = ({files, helpers, moduleCache, sourceExts}) => {
import type {Moduleish} from '../../node-haste/DependencyGraph/ResolutionRequest';
import type {ResolveFn, TransformedCodeFile} from '../types.flow';
import type {Extensions, Path} from './node-haste.flow';
import type {CustomResolver} from 'metro-resolver';
type ResolveOptions = {|
assetExts: Extensions,
extraNodeModules: {[id: string]: string, ...},
mainFields: $ReadOnlyArray,
resolveRequest?: ?CustomResolver,
+sourceExts: Extensions,
transformedFiles: {[path: Path]: TransformedCodeFile, ...},
+platform: string,
|};
const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = 'g';
const PACKAGE_JSON = path.sep + 'package.json';
const NULL_MODULE: Moduleish = {
path: '/',
getPackage(): void {},
isHaste() {
throw new Error('not implemented');
},
getName() {
throw new Error('not implemented');
},
};
// This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
const createModuleMap = ({files, helpers, moduleCache, sourceExts}) => {