feat(botfilter): add normaliseExtensions

This commit is contained in:
hoelee committed 2026-01-19 15:40:00 +08:00
1 parent b0af2468b7
commit 0c024403f1
1 file changed
+15
+15
View File
@@ -70,3 +70,18 @@ func normalisePaths(values []string) []string {
return result
}
func normaliseExtensions(values []string) []string {
result := make([]string, 0, len(values))
for _, value := range values {
value = strings.ToLower(strings.TrimSpace(value))
if value == "" {
continue
}
if !strings.HasPrefix(value, ".") {
value = "." + value
}
result = append(result, value)
}
return result
}