feat(botfilter): add normaliseExtensions
This commit is contained in:
1 parent
b0af2468b7
commit
0c024403f1
1 file changed
+15
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user