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

Function convertInputToString

apps/sim/app/api/guardrails/validate/route.ts:294–305  ·  view source on GitHub ↗

* Convert input to string for validation

(input: any)

Source from the content-addressed store, hash-verified

292 * Convert input to string for validation
293 */
294function convertInputToString(input: any): string {
295 if (typeof input === 'string') {
296 return input
297 }
298 if (input === null || input === undefined) {
299 return ''
300 }
301 if (typeof input === 'object') {
302 return JSON.stringify(input)
303 }
304 return String(input)
305}
306
307/**
308 * Execute validation using TypeScript validators

Callers 1

route.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected