tlojs
Version:
The Last One - The last npm package you'll need to install
26 lines (25 loc) • 793 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableRow = void 0;
var cell_1 = require("./cell");
var exceptions_1 = require("./exceptions");
var TableRow = /** @class */ (function () {
function TableRow(data) {
this.data = data;
this.cells = cell_1.TableCell.fromData(data);
}
TableRow.prototype.getCol = function (idx) {
if (this.cells.length <= idx) {
throw new Error(exceptions_1.INVALID_COLUMN_INDEX);
}
return this.cells[idx];
};
TableRow.prototype.destroy = function () {
this.cells = [];
};
TableRow.fromData = function (data) {
return data.map(function (x) { return new TableRow(x); });
};
return TableRow;
}());
exports.TableRow = TableRow;