 (enable-console-print!)
 
 (defn get-attrs [node]
-  (if (.hasAttributes node)
+  (if (.-attributes node)
     (into {}
           (let [attrs (.-attributes node)]
             (for [i (range (.-length attrs))

   (let [all-html (.-documentElement (goog.dom/getDocument))]
     (snapshot all-html)))
  ([node]
   (let [basic-mapping {:node-name (.-nodeName node)
                        :attributes (get-attrs node)
                        :children (get-children node)}
         complete-mapping (complete-map basic-mapping node)]
     complete-mapping)))

(println "snapshot result" (snapshot))

              [name value])))
    {}))

(defn handle-special-nodes
  "Fills in important node-specific key-val pairs"
  [node-map native-node]
  (let [node-types goog.dom/NodeType]
    (condp = (.-nodeType native-node)
      (.-COMMENT node-types) (assoc node-map :text (.-nodeValue native-node))
      node-map)))

(defn gen-basic-node-map [node]
  {:node-name (.-nodeName node)
   :attributes (get-attrs node)})

(defn snapshot
  "Recursively serialize validated nodes into a clojure data structure"
