MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / sanitizeFilename

Function sanitizeFilename

src/runtime/adapters/attachment-utils.ts:29–31  ·  view source on GitHub ↗

* Sanitise a filename to remove path separators and other unsafe characters.

(name: string)

Source from the content-addressed store, hash-verified

27 * Sanitise a filename to remove path separators and other unsafe characters.
28 */
29function sanitizeFilename(name: string): string {
30 return name.replace(/[/\\:*?"<>|]/g, "_").replace(/\s+/g, "_");
31}
32
33/**
34 * Save a buffer as an attachment file and return a ChannelAttachment descriptor.

Callers 2

saveAttachmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected