mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
15 lines
450 B
Go
15 lines
450 B
Go
package clean
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// FormatSep defines the string separating multiple format identifiers in a list.
|
|
const FormatSep = ","
|
|
|
|
// Format lowercases and strips the surrounding whitespace and punctuation
|
|
// from format identifiers so that inputs like `"mp4"`, ` .avi `, or `magicyuv,`
|
|
// normalize to canonical short names suitable for map lookups.
|
|
func Format(s string) string {
|
|
return strings.ToLower(strings.Trim(s, " .,;:\"'`"))
|
|
}
|