 (ns zirconia.utils
-  (:require [clojure.string :refer (split trim join lower-case upper-case)]
+  (:require [clojure.string :refer (split trim join lower-case)]
             [cljs.reader :as reader]))
 
 (extend-type js/RegExp

       (response->edn)))

(defn event->command
  "Converts an event hash-map with keys :command :args into a raw request"
  [{:keys [command args]}]
  (str (name command) " " (join " " args) "\n"))

(defn command->event
  "Converts a raw request back into its hash-map equivalent"
  [data]
  (let [[command & args] (-> data (split #"\n") first trim (split #" "))]
    {:command (keyword command)

      [(camel->lisp k)
       (->> rest (join ":") trim read-string*)])))

(defn response->edn
  "Transforms a response from server to EDN friendly format

