cljs-ajax icon indicating copy to clipboard operation
cljs-ajax copied to clipboard

qualified keywords not showing in json-request-format

Open sirmspencer opened this issue 1 year ago • 0 comments

Similar to https://github.com/JulianBirch/cljs-ajax/issues/260, but for the json-request-format.

Instead of losing namespace (clj->js {:a/b 123}) => #js {:b 123}

Keep it in the final key str.

(defn- nsq-keyword-fn [k]
  (let [ns (namespace k)
        n  (name k)]
    (if ns
      (str ns "/" n)
      n)))

(clj->js {:a/b 123} :keyword-fn nsq-keyword-fn) => #js {"a/b" 123}

sirmspencer avatar Jan 17 '24 16:01 sirmspencer