MCPcopy
hub / github.com/simstudioai/sim / slugifyColumnName

Function slugifyColumnName

apps/sim/lib/table/column-naming.ts:16–24  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

14 * results fall back to `output`.
15 */
16export 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

Callers 1

deriveOutputColumnNameFunction · 0.85

Calls 2

testMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected