function | since v1.11.50 | Edit |
(seq-to-map-for-destructuring s)
Builds a map from a seq as described in https://clojure.org/reference/special_forms#keyword-arguments
(defn seq-to-map-for-destructuring
[s]
(if (next s)
(.createAsIfByAssoc PersistentArrayMap (to-array s))
(if (seq s) (first s) (.-EMPTY PersistentArrayMap))))