(tableOptions, cells)
| 47 | } |
| 48 | |
| 49 | mergeTableOptions(tableOptions, cells) { |
| 50 | this.cells = cells; |
| 51 | |
| 52 | let optionsChars = this.options.chars || {}; |
| 53 | let tableChars = tableOptions.chars; |
| 54 | let chars = (this.chars = {}); |
| 55 | CHAR_NAMES.forEach(function (name) { |
| 56 | setOption(optionsChars, tableChars, name, chars); |
| 57 | }); |
| 58 | |
| 59 | this.truncate = this.options.truncate || tableOptions.truncate; |
| 60 | |
| 61 | let style = (this.options.style = this.options.style || {}); |
| 62 | let tableStyle = tableOptions.style; |
| 63 | setOption(style, tableStyle, 'padding-left', this); |
| 64 | setOption(style, tableStyle, 'padding-right', this); |
| 65 | this.head = style.head || tableStyle.head; |
| 66 | this.border = style.border || tableStyle.border; |
| 67 | |
| 68 | this.fixedWidth = tableOptions.colWidths[this.x]; |
| 69 | this.lines = this.computeLines(tableOptions); |
| 70 | |
| 71 | this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight; |
| 72 | this.desiredHeight = this.lines.length; |
| 73 | } |
| 74 | |
| 75 | computeLines(tableOptions) { |
| 76 | const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap; |
no test coverage detected