(config: Config.ProjectConfig)
| 84 | const NODE_MODULES = `${path.sep}node_modules${path.sep}`; |
| 85 | |
| 86 | const getModuleNameMapper = (config: Config.ProjectConfig) => { |
| 87 | if ( |
| 88 | Array.isArray(config.moduleNameMapper) && |
| 89 | config.moduleNameMapper.length > 0 |
| 90 | ) { |
| 91 | return config.moduleNameMapper.map(([regex, moduleName]) => ({ |
| 92 | moduleName, |
| 93 | regex: new RegExp(regex), |
| 94 | })); |
| 95 | } |
| 96 | return null; |
| 97 | }; |
| 98 | |
| 99 | export default class Runtime { |
| 100 | private readonly fileCache: FileCache; |