MCPcopy Index your code
hub / github.com/simstudioai/sim / sanitizeSingleIdentifier

Function sanitizeSingleIdentifier

apps/sim/app/api/tools/mysql/utils.ts:172–182  ·  view source on GitHub ↗
(identifier: string)

Source from the content-addressed store, hash-verified

170}
171
172function sanitizeSingleIdentifier(identifier: string): string {
173 const cleaned = identifier.replace(/`/g, '')
174
175 if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(cleaned)) {
176 throw new Error(
177 `Invalid identifier: ${identifier}. Identifiers must start with a letter or underscore and contain only letters, numbers, and underscores.`
178 )
179 }
180
181 return `\`${cleaned}\``
182}
183
184export interface MySQLIntrospectionResult {
185 tables: Array<{

Callers 1

sanitizeIdentifierFunction · 0.70

Calls 2

testMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected