(dirPath)
| 8 | import { getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils'; |
| 9 | |
| 10 | function getPackageEntryPoint(dirPath) { |
| 11 | let entryPoint = 'index.js'; |
| 12 | |
| 13 | try { |
| 14 | if (existsSync(join(dirPath, 'package.json'))) { |
| 15 | entryPoint = |
| 16 | JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main || |
| 17 | entryPoint; |
| 18 | } |
| 19 | } catch (ignored) { |
| 20 | // ignored |
| 21 | } |
| 22 | |
| 23 | return entryPoint; |
| 24 | } |
| 25 | |
| 26 | function isDirectory(path) { |
| 27 | try { |
no outgoing calls
no test coverage detected