(width: number | string, tableWidth: number)
| 37 | } |
| 38 | |
| 39 | export function parseStaticWidth(width: number | string, tableWidth: number): number { |
| 40 | if (typeof width === 'string') { |
| 41 | let match = width.match(/^(\d+)(?=%$)/); |
| 42 | if (!match) { |
| 43 | throw new Error('Only percentages or numbers are supported for static column widths'); |
| 44 | } |
| 45 | return tableWidth * (parseFloat(match[0]) / 100); |
| 46 | } |
| 47 | return width; |
| 48 | } |
| 49 | |
| 50 | export function getMaxWidth( |
| 51 | maxWidth: number | string | null | undefined, |
no outgoing calls
no test coverage detected