Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.getSourceFile = function (fileName, languageVersion, onError) {
var sourceFile = _this.oldProgram.getSourceFile(fileName);
var isDefinitions = /\.d\.ts$/.test(fileName);
// Don't tsickle-process any d.ts that isn't a compilation target;
// this means we don't process e.g. lib.d.ts.
if (isDefinitions)
return sourceFile;
var _a = tsickle.annotate(_this.oldProgram, sourceFile, { untyped: true }), output = _a.output, externs = _a.externs, diagnostics = _a.diagnostics;
_this.diagnostics = diagnostics;
return ts.createSourceFile(fileName, output, languageVersion, true);
};
}