gherkin-ast
Version:
JS model for Gherkin feature files
36 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableCell = void 0;
const common_1 = require("../common");
const uniqueObject_1 = require("./uniqueObject");
const debug_1 = require("../debug");
const debug = (0, debug_1.getDebugger)("TableCell");
/**
* Model for TableCell
*/
class TableCell extends uniqueObject_1.UniqueObject {
static parse(obj) {
debug("parse(obj: %o)", obj);
if (!obj || !("value" in obj)) {
throw new TypeError("The given object is not a TableCell!");
}
const cell = new TableCell(obj.value);
debug("parse(this: {value: '%s'})", cell.value);
return cell;
}
constructor(value) {
super();
this.value = value;
debug("constructor(value: '%s')", value);
}
clone() {
debug("clone(this: {value: '%s'})", this.value);
return new TableCell(this.value);
}
replace(key, value) {
debug("replace(key: '%s', value: '%s')", key, value);
this.value = (0, common_1.replaceAll)(this.value, key, value);
}
}
exports.TableCell = TableCell;
//# sourceMappingURL=tableCell.js.map