all files / src/ rtextcell.js

100% Statements 11/11
100% Branches 2/2
100% Functions 2/2
100% Lines 11/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21       17×       11× 11×        
const TextCell = require("./textcell.js");
 
class RTextCell extends TextCell {
  constructor(text) {
    super(text);
  }
 
  draw(width, height) {
    var result = [];
    for (var i = 0; i < height; i++) {
      var line = this.text[i] || "";
      result.push(super.repeat(" ", width - line.length) + line);
    }
    return result;
  }
}
const {addMapClass, findClass} = require("./registry-class");
addMapClass("Number", RTextCell);
addMapClass("RTextCell", RTextCell);
module.exports = RTextCell;