ts-simple-ast
Version:
TypeScript compiler wrapper for static analysis and code manipulation.
19 lines (18 loc) • 973 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var errors = require("../../errors");
var FactoryStructurePrinter_1 = require("../FactoryStructurePrinter");
var JsxSpreadAttributeStructurePrinter = /** @class */ (function (_super) {
tslib_1.__extends(JsxSpreadAttributeStructurePrinter, _super);
function JsxSpreadAttributeStructurePrinter() {
return _super !== null && _super.apply(this, arguments) || this;
}
JsxSpreadAttributeStructurePrinter.prototype.printText = function (writer, structure) {
errors.throwIfTrue(!structure.isSpreadAttribute, "Should be a spread attribute when writing one.");
writer.write("...");
writer.write(structure.expression);
};
return JsxSpreadAttributeStructurePrinter;
}(FactoryStructurePrinter_1.FactoryStructurePrinter));
exports.JsxSpreadAttributeStructurePrinter = JsxSpreadAttributeStructurePrinter;