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

Function sanitizeBedrockName

apps/sim/providers/attachments.ts:622–626  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

620}
621
622function sanitizeBedrockName(filename: string): string {
623 const baseName = filename.replace(/\.[^/.]+$/, '').replace(/[^a-zA-Z0-9\s()[\]-]/g, ' ')
624 const compacted = baseName.replace(/\s+/g, ' ').trim()
625 return compacted || 'Document'
626}
627
628function getBedrockDocumentFormat(attachment: PreparedProviderAttachment): string {
629 if (attachment.extension === 'md' || attachment.mimeType === 'text/markdown') return 'md'

Callers 1

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected