Open waffletower opened 6 years ago
The type-preserving functions throw an exception for namespaced keywords:
(try
(->kebab-case :hmm.com/MonkeyFace)
(catch Exception e
(.getMessage e)))
; => "Namespaced keywords are not supported"
The type-converting functions should do the same to be consistent and match the documentation at https://github.com/qerub/camel-snake-kebab/blame/master/README.md#L77.
In what situation do you want to transform namespaced keywords?
Related issue: #8
I have a use case for transforming - and the might be a better option there.
The use case would be when you have a clojure.java.jdbc
call that contains :qualifier
:
(clj-jdbc/execute! db-spec-or-tx multi-sql-params {:return-keys true
:multi? true
:qualifier "core2.models.file"
:transaction? true
:row-fn csk->kebab-case})
I can work around it by doing both conversions in :row-fn
clearly here but I just wanted to report the use case...
...and it turns out there exists a :identifiers
functionality for doing that before :qualifier
is applied.
Therefore the following works for me without any change to camel-snake-kebab
:
(clj-jdbc/execute! db-spec-or-tx multi-sql-params {:return-keys true
:multi? true
:identifiers csk->kebab-case
:qualifier "core2.models.file"
:transaction? true})
Expected
(->kebab-case-keyword :hmm.com/MonkeyFace)
=>:hmm.com/monkey-face
Actual =>monkey-face