* Gets the source files that are expected to have an emit output. * * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support * transformations. * * @param host An EmitHost. * @param targetSourceFile An optional target source file to em
(host, targetSourceFile, forceDtsEmit)
| 18467 | * @param targetSourceFile An optional target source file to emit. |
| 18468 | */ |
| 18469 | function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) { |
| 18470 | var options = host.getCompilerOptions(); |
| 18471 | if (outFile(options)) { |
| 18472 | var moduleKind = getEmitModuleKind(options); |
| 18473 | var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; |
| 18474 | // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified |
| 18475 | return ts.filter(host.getSourceFiles(), function (sourceFile) { |
| 18476 | return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && |
| 18477 | sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); |
| 18478 | }); |
| 18479 | } |
| 18480 | else { |
| 18481 | var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; |
| 18482 | return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); }); |
| 18483 | } |
| 18484 | } |
| 18485 | ts.getSourceFilesToEmit = getSourceFilesToEmit; |
| 18486 | /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */ |
| 18487 | function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { |
nothing calls this directly
no test coverage detected