( input: string, filename: string, language: 'flow' | 'typescript', sourceType: 'module' | 'script', )
| 100 | } |
| 101 | |
| 102 | export function parseInput( |
| 103 | input: string, |
| 104 | filename: string, |
| 105 | language: 'flow' | 'typescript', |
| 106 | sourceType: 'module' | 'script', |
| 107 | ): BabelCore.types.File { |
| 108 | // Extract the first line to quickly check for custom test directives |
| 109 | if (language === 'flow') { |
| 110 | return HermesParser.parse(input, { |
| 111 | babel: true, |
| 112 | flow: 'all', |
| 113 | sourceFilename: filename, |
| 114 | sourceType, |
| 115 | enableExperimentalComponentSyntax: true, |
| 116 | }); |
| 117 | } else { |
| 118 | return BabelParser.parse(input, { |
| 119 | sourceFilename: filename, |
| 120 | plugins: ['typescript', 'jsx'], |
| 121 | sourceType, |
| 122 | }); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | function getEvaluatorPresets( |
| 127 | language: 'typescript' | 'flow', |
no outgoing calls
no test coverage detected