(merge-to-vector force-list m1 m2)
With two input maps, associate common keys into vectors and return result map containing all input data. Coerces common key values into vectors. Input maps:
{:a 1 :b 2 :c 3} {:a 2 :b 4 } Example Output {:a [1 2] :b [2 4] :c 3}
With two input maps, associate common keys into vectors and return result map containing all input data. Coerces common key values into vectors. Input maps: {:a 1 :b 2 :c 3} {:a 2 :b 4 } Example Output {:a [1 2] :b [2 4] :c 3}
(nil-if-empty m)
If empty return nil. Useful for a list like this: [] to go to this: nil
If empty return nil. Useful for a list like this: [] to go to this: nil
(prefix-keywords attrs-prefix hash-map)
Prefixes keywords in a map, and returns same map with prefixed arguments.
(prefix-keywords "new_" ) => {:new_a 1}
Prefixes keywords in a map, and returns same map with prefixed arguments. (prefix-keywords "new_" ) => {:new_a 1}
(xml->json xml-map)
(xml->json {:keys [tag] :as xml-map} opt-map)
Receives xml map (as provided by clojure.xml) and returns json-like hash map.
opt-map
Optional second map with keys [force-list, attr-prefix] specify
lists to be forced into vectors and what to prefix xml attributes with.
TODO more docs.
Receives xml map (as provided by clojure.xml) and returns json-like hash map. `opt-map` Optional second map with keys [force-list, attr-prefix] specify lists to be forced into vectors and what to prefix xml attributes with. TODO more docs.
(xml-merge-parts prefix-fn walk-coll-fn force-list {:keys [attrs content tag]})
Merges :attrs and :content to :tag of xml parsed through clojure.(data).xml.
Merges :attrs and :content to :tag of xml parsed through clojure.(data).xml.
(xml-only-text m)
If XML is only a text node return that. TODO make the text key configurable?
If XML is only a text node return that. TODO make the text key configurable?
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close