From 3ecac63bea08e2413c0d6eca821123461f3be37e Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Wed, 8 Jan 2025 17:52:29 +0200 Subject: [PATCH] Check for hyphen in dehyphen before calling str/replace --- src/honey/sql.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 7030653..34f0162 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -227,7 +227,8 @@ Hyphens at the start or end of a string should not be touched." [s] - (str/replace s #"(\w)-(?=\w)" "$1 ")) + (cond-> s + (str/includes? s "-") (str/replace #"(\w)-(?=\w)" "$1 "))) (defn- namespace-_ "Return the namespace portion of a symbol, with dashes converted."