(value: string)
| 14 | * results fall back to `output`. |
| 15 | */ |
| 16 | export function slugifyColumnName(value: string): string { |
| 17 | let slug = value |
| 18 | .toLowerCase() |
| 19 | .replace(/[^a-z0-9_]+/g, '_') |
| 20 | .replace(/^_+|_+$/g, '') |
| 21 | if (!slug) slug = 'output' |
| 22 | if (/^[0-9]/.test(slug)) slug = `c_${slug}` |
| 23 | return slug |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Pick a non-colliding column name for a block-output `path`. Uses the bare |
no test coverage detected