Convert a list of length 1 into its contents, leaving other things alone.
Used to simplify keys in the tabular data API.
(defn maybe-atomize
"Convert a list of length 1 into its contents, leaving other things alone.
Used to simplify keys in the tabular data API."
[k]
(if (and (instance? java.util.List k)
(= 1 (count k)))
(first k)
k))
Comments top
No comments for maybe-atomize. Log in to add a comment.