( table: MarkdownTable, index: number )
| 340 | } |
| 341 | |
| 342 | export function duplicateColumn( |
| 343 | table: MarkdownTable, |
| 344 | index: number |
| 345 | ): MarkdownTable { |
| 346 | if (index < 0 || index >= columnCount(table)) return table |
| 347 | const next = clone(table) |
| 348 | next.headers.splice(index + 1, 0, next.headers[index]) |
| 349 | next.aligns.splice(index + 1, 0, next.aligns[index]) |
| 350 | for (const row of next.rows) row.splice(index + 1, 0, row[index]) |
| 351 | return next |
| 352 | } |
| 353 | |
| 354 | export function moveColumn( |
| 355 | table: MarkdownTable, |
no test coverage detected