MCPcopy Create free account
hub / github.com/codeaashu/claude-code / sanitizeFilename

Function sanitizeFilename

src/commands/export/export.tsx:42–48  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

40 return result;
41}
42export function sanitizeFilename(text: string): string {
43 // Replace special characters with hyphens
44 return text.toLowerCase().replace(/[^a-z0-9\s-]/g, '') // Remove special chars
45 .replace(/\s+/g, '-') // Replace spaces with hyphens
46 .replace(/-+/g, '-') // Replace multiple hyphens with single
47 .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens
48}
49async function exportWithReactRenderer(context: ToolUseContext): Promise<string> {
50 const tools = context.options.tools || [];
51 return renderMessagesToPlainText(context.messages, tools);

Callers 1

callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected