ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
51 lines (50 loc) • 1.87 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 Diagnostic_1 = require("./Diagnostic");
var utils_1 = require("./../../../utils");
/**
* Result of an emit.
*/
var EmitResult = /** @class */ (function () {
/**
* @internal
*/
function EmitResult(global, compilerObject) {
this.global = global;
this._compilerObject = compilerObject;
}
Object.defineProperty(EmitResult.prototype, "compilerObject", {
/**
* TypeScript compiler emit result.
*/
get: function () {
return this._compilerObject;
},
enumerable: true,
configurable: true
});
/**
* If the emit was skipped.
*/
EmitResult.prototype.getEmitSkipped = function () {
return this.compilerObject.emitSkipped;
};
/**
* Contains declaration emit diagnostics.
*/
EmitResult.prototype.getDiagnostics = function () {
var _this = this;
return this.compilerObject.diagnostics.map(function (d) { return new Diagnostic_1.Diagnostic(_this.global, d); });
};
__decorate([
utils_1.Memoize
], EmitResult.prototype, "getDiagnostics", null);
return EmitResult;
}());
exports.EmitResult = EmitResult;