From 0c024403f1311ed645b752ffa691227d3bce7ea2 Mon Sep 17 00:00:00 2001 From: hoelee Date: Mon, 19 Jan 2026 15:40:00 +0800 Subject: [PATCH] feat(botfilter): add normaliseExtensions --- util.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util.go b/util.go index 61359290..b166f945 100644 --- a/util.go +++ b/util.go @@ -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 +} +