 (ns pp.client.format
   (:require [cljfmt.core :refer [reformat-string]]
             [pp.client.util :refer [js-log log]]
+            [clojure.walk :refer [keywordize-keys]]
             [cljs.pprint :as p]
             [cljs.reader :as r]
+            [camel-snake-kebab.core :refer [->kebab-case-keyword]]
+            [camel-snake-kebab.extras :refer [transform-keys]]
             cljsjs.js-beautify
             cljsjs.parinfer))
 

                      #(.-text %)
                      js/parinfer.indentMode))

(defn format-input! [style input]
  (case style
    :clj  (normalize-result format-clj input)
    :edn  (normalize-result format-edn input)
    :json (normalize-result js/js_beautify input {:indent_size           2
                                                  :indent_char           " "
                                                  :max_preserve_newlines 2})))

    (catch js/Object e
      (assoc {} :error e))))

(def js-settings {:indent_size           2
                  :indent_char           " "
                  :max_preserve_newlines 2})

;; compose a function to transfor erroneous output
(def format-clj (comp reformat-string
                      #(.-text %)
                      js/parinfer.indentMode))

(defn- pp-str [s]
  (-> s
