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

Method computeLines

src/cell.js:75–92  ·  view source on GitHub ↗
(tableOptions)

Source from the content-addressed store, hash-verified

73 }
74
75 computeLines(tableOptions) {
76 const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap;
77 const { wordWrap = tableWordWrap } = this.options;
78 if (this.fixedWidth && wordWrap) {
79 this.fixedWidth -= this.paddingLeft + this.paddingRight;
80 if (this.colSpan) {
81 let i = 1;
82 while (i < this.colSpan) {
83 this.fixedWidth += tableOptions.colWidths[this.x + i];
84 i++;
85 }
86 }
87 const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions;
88 const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;
89 return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
90 }
91 return this.wrapLines(this.content.split('\n'));
92 }
93
94 wrapLines(computedLines) {
95 const lines = utils.colorizeLines(computedLines);

Callers 1

mergeTableOptionsMethod · 0.95

Calls 1

wrapLinesMethod · 0.95

Tested by

no test coverage detected