MCPcopy Create free account
hub / github.com/cli-table/cli-table3 / _topLeftChar

Method _topLeftChar

src/cell.js:184–213  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

182 }
183
184 _topLeftChar(offset) {
185 let x = this.x + offset;
186 let leftChar;
187 if (this.y == 0) {
188 leftChar = x == 0 ? 'topLeft' : offset == 0 ? 'topMid' : 'top';
189 } else {
190 if (x == 0) {
191 leftChar = 'leftMid';
192 } else {
193 leftChar = offset == 0 ? 'midMid' : 'bottomMid';
194 if (this.cells) {
195 //TODO: cells should always exist - some tests don't fill it in though
196 let spanAbove = this.cells[this.y - 1][x] instanceof Cell.ColSpanCell;
197 if (spanAbove) {
198 leftChar = offset == 0 ? 'topMid' : 'mid';
199 }
200 if (offset == 0) {
201 let i = 1;
202 while (this.cells[this.y][x - i] instanceof Cell.ColSpanCell) {
203 i++;
204 }
205 if (this.cells[this.y][x - i] instanceof Cell.RowSpanCell) {
206 leftChar = 'leftMid';
207 }
208 }
209 }
210 }
211 }
212 return this.chars[leftChar];
213 }
214
215 wrapWithStyleColors(styleProperty, content) {
216 if (this[styleProperty] && this[styleProperty].length) {

Callers 1

drawTopMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected