Skip to content

Commit

Permalink
refactor: allow empty strings as input in uppercase-first-letter
Browse files Browse the repository at this point in the history
  • Loading branch information
krvital committed Sep 26, 2024
1 parent c19c799 commit 6409d90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aidbox_sdk/generator/helpers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 6409d90

Please sign in to comment.