feat(botfilter): add normaliseExtensions

This commit is contained in:
hoelee committed 2026-01-14 15:40:00 +08:00
1 parent 3ed08431b4
commit a150d3a74e
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
}