ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
51 lines (50 loc) • 1.88 kB
JavaScript
;
var __decorate = (this && this.__decorate)/* istanbul ignore next */ || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./../../../utils");
var OutputFile_1 = require("./OutputFile");
/**
* Output of an emit on a single file.
*/
var EmitOutput = /** @class */ (function () {
/**
* @internal
*/
function EmitOutput(global, filePath, compilerObject) {
this.filePath = filePath;
this.global = global;
this._compilerObject = compilerObject;
}
Object.defineProperty(EmitOutput.prototype, "compilerObject", {
/**
* TypeScript compiler emit result.
*/
get: function () {
return this._compilerObject;
},
enumerable: true,
configurable: true
});
/**
* Gets if the emit was skipped.
*/
EmitOutput.prototype.getEmitSkipped = function () {
return this.compilerObject.emitSkipped;
};
/**
* Gets the output files.
*/
EmitOutput.prototype.getOutputFiles = function () {
return this.compilerObject.outputFiles.map(function (f) { return new OutputFile_1.OutputFile(f); });
};
__decorate([
utils_1.Memoize
], EmitOutput.prototype, "getOutputFiles", null);
return EmitOutput;
}());
exports.EmitOutput = EmitOutput;