MCPcopy Create free account
hub / github.com/blues/note / FileCleanName

Function FileCleanName

lib/file.go:103–111  ·  view source on GitHub ↗

FileCleanName generates a clean filename with correct extension from a filename input

(filename string)

Source from the content-addressed store, hash-verified

101
102// FileCleanName generates a clean filename with correct extension from a filename input
103func FileCleanName(filename string) string {
104 if cleanWithJSONExtension {
105 return fsCleanName(filename) + ".json"
106 }
107 if filename == defaultFileStorageName {
108 return fsCleanName(filename + defaultFileStorageExt)
109 }
110 return fsCleanName(filename)
111}
112
113// Generate a filename given some hints that are used to 'weigh in' on the aesthetics
114func fsFilename(storageHint string, filenameHint string) string {

Callers 1

fsFilenameFunction · 0.85

Calls 1

fsCleanNameFunction · 0.85

Tested by

no test coverage detected