ts-simple-ast
Version:
TypeScript compiler wrapper for static analysis and code manipulation.
40 lines (39 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var Node_1 = require("../../common/Node");
var expressioned_1 = require("../expressioned");
var manipulation_1 = require("../../../../manipulation");
var callBaseSet_1 = require("../../callBaseSet");
var callBaseGetStructure_1 = require("../../callBaseGetStructure");
exports.SpreadAssignmentBase = expressioned_1.ExpressionedNode(Node_1.Node);
var SpreadAssignment = /** @class */ (function (_super) {
tslib_1.__extends(SpreadAssignment, _super);
function SpreadAssignment() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Removes this property.
*/
SpreadAssignment.prototype.remove = function () {
manipulation_1.removeCommaSeparatedChild(this);
};
/**
* Sets the node from a structure.
* @param structure - Structure to set the node with.
*/
SpreadAssignment.prototype.set = function (structure) {
callBaseSet_1.callBaseSet(exports.SpreadAssignmentBase.prototype, this, structure);
return this;
};
/**
* Gets the structure equivalent to this node.
*/
SpreadAssignment.prototype.getStructure = function () {
return callBaseGetStructure_1.callBaseGetStructure(exports.SpreadAssignmentBase.prototype, this, {
expression: this.getExpression().getText()
});
};
return SpreadAssignment;
}(exports.SpreadAssignmentBase));
exports.SpreadAssignment = SpreadAssignment;