From 6409d903bba2d9872dc0e679de0fedea7bacc415 Mon Sep 17 00:00:00 2001 From: Vitaly Kravtsov Date: Thu, 26 Sep 2024 18:00:03 +0600 Subject: [PATCH] refactor: allow empty strings as input in uppercase-first-letter --- src/aidbox_sdk/generator/helpers.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aidbox_sdk/generator/helpers.clj b/src/aidbox_sdk/generator/helpers.clj index e3b0634..1717127 100644 --- a/src/aidbox_sdk/generator/helpers.clj +++ b/src/aidbox_sdk/generator/helpers.clj @@ -24,8 +24,8 @@ "NOTE: Do not confuse with `capitalize` and `->pascal-case` functions. Capitalize function lowercasing all letters after first. Pascal case removes all _ and - characters" - [string] - (str (str/upper-case (first string)) (subs string 1))) + [s] + (str (str/upper-case (get s 0 "")) (str/join (rest s)))) (defn starts-with-capital? [^String s] (Character/isUpperCase (.charAt s 0)))