aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/util.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/web/util.scm')
-rw-r--r--guix-data-service/web/util.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guix-data-service/web/util.scm b/guix-data-service/web/util.scm
index 439c581..1dd193a 100644
--- a/guix-data-service/web/util.scm
+++ b/guix-data-service/web/util.scm
@@ -28,6 +28,7 @@
directory?
hyphenate-words
+ remove-brackets
underscore-join-words))
(define (most-appropriate-mime-type accepted-mime-types
@@ -99,6 +100,14 @@
(string-split words #\space)
"-"))
+(define (remove-brackets s)
+ (string-filter
+ (lambda (c)
+ (not
+ (or (eq? #\( c)
+ (eq? #\) c))))
+ s))
+
(define (underscore-join-words words)
(string-join
(string-split words #\space)