ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
28 lines (26 loc) • 869 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const callBaseFill_1 = require("./../callBaseFill");
function AsyncableNode(Base) {
return class extends Base {
isAsync() {
return this.hasModifier(ts.SyntaxKind.AsyncKeyword);
}
getAsyncKeyword() {
return this.getFirstModifierByKind(ts.SyntaxKind.AsyncKeyword);
}
setIsAsync(value) {
this.toggleModifier("async", value);
return this;
}
fill(structure) {
callBaseFill_1.callBaseFill(Base.prototype, this, structure);
if (structure.isAsync != null)
this.setIsAsync(structure.isAsync);
return this;
}
};
}
exports.AsyncableNode = AsyncableNode;
//# sourceMappingURL=AsyncableNode.js.map