ts-simple-ast
Version:
TypeScript compiler wrapper for static analysis and code manipulation.
28 lines (27 loc) • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var callBaseSet_1 = require("../../callBaseSet");
function ExpressionedNode(Base) {
return /** @class */ (function (_super) {
tslib_1.__extends(class_1, _super);
function class_1() {
return _super !== null && _super.apply(this, arguments) || this;
}
class_1.prototype.getExpression = function () {
return this._getNodeFromCompilerNode(this.compilerNode.expression);
};
class_1.prototype.setExpression = function (textOrWriterFunction) {
this.getExpression().replaceWithText(textOrWriterFunction);
return this;
};
class_1.prototype.set = function (structure) {
callBaseSet_1.callBaseSet(Base.prototype, this, structure);
if (structure.expression != null)
this.setExpression(structure.expression);
return this;
};
return class_1;
}(Base));
}
exports.ExpressionedNode = ExpressionedNode;