ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
32 lines (30 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const errors = require("./../../errors");
const callBaseFill_1 = require("./../callBaseFill");
function StaticableNode(Base) {
return class extends Base {
isStatic() {
return this.hasModifier(ts.SyntaxKind.StaticKeyword);
}
getStaticKeyword() {
return this.getFirstModifierByKind(ts.SyntaxKind.StaticKeyword);
}
getStaticKeywordOrThrow() {
return errors.throwIfNullOrUndefined(this.getStaticKeyword(), "Expected to find a static keyword.");
}
setIsStatic(value) {
this.toggleModifier("static", value);
return this;
}
fill(structure) {
callBaseFill_1.callBaseFill(Base.prototype, this, structure);
if (structure.isStatic != null)
this.setIsStatic(structure.isStatic);
return this;
}
};
}
exports.StaticableNode = StaticableNode;
//# sourceMappingURL=StaticableNode.js.map