Skip to content

Commit

Permalink
allow custom encoding of PersistentQueue for encode* (using bypass)
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Mar 9, 2012
1 parent 1a12078 commit 3b9a15b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/cheshire/custom.clj
Expand Up @@ -199,6 +199,10 @@
JSONable
{:to-json encode-seq})

(extend clojure.lang.IPersistentList
JSONable
{:to-json encode-seq})

(extend java.util.Date
JSONable
{:to-json encode-date})
Expand Down
3 changes: 2 additions & 1 deletion test/cheshire/test/custom.clj
Expand Up @@ -169,4 +169,5 @@

(deftest t-persistent-queue
(let [q (conj (clojure.lang.PersistentQueue/EMPTY) 1 2 3)]
(is (= q (json/decode (json/encode q))))))
(is (= q (json/decode (json/encode q))))
(is (= q (json/decode (json/encode* q))))))

0 comments on commit 3b9a15b

Please sign in to comment.