camel-snake-kebab
camel-snake-kebab copied to clipboard
A Clojure[Script] library for word case conversions
Any string that starts with an underscore or dash has the underscore or dash removed in the result. ex: (->kebab-case "_my_string") => "my-string" (->kebab-case "-my-string") => "my-string" ex of NullPointerException:...
There's unexpected behavior when mixing numbers and characters on an identifier which is not demonstrated on any of the tests. This makes sense: ``` (->kebab-case-keyword :user_id) => :user-id (->kebab-case-keyword :user_1)...
I personally rather like bijections more than coercions. E.g., if I have a web API that is supposed to accept snake case query params and I use `->kebab-case` to translate...
``` (let [s "word100word"] (= (->snake_case (->kebab-case s)) "word100word")) => false ``` becaouse ``` (->kebab-case "word100word") => "word-100-word" (->snake_case "word-100-word") => "word_100_word" (->snake_case "word100word") => "word_100word" ``` In my opinion...
Would love to have `:kebab-case => "Kebab Case"` for display purposes.
Should there be a counterpart to `transform-keys` called `transform-values`? This would apply `t` to non-map leaves. I have a current project where a kebabed value can appear both in key...
Sometimes I need to convert keywords and environment variables to/from the Java system properties syntax that [environ](https://github.com/weavejester/environ) uses, eg: ``` clojure :database-url -> DATABASE_URL -> database.url ``` Would be nice...