forked from joegallo/doric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua Davey
committed
Mar 17, 2017
1 parent
290b2e7
commit bc9d10a
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns doric.json | ||
(:require [cheshire.core :as json] | ||
[doric.protocols :as proto])) | ||
|
||
(defrecord JSONRenderer [cheshire-opts] | ||
proto/Render | ||
(-render-lazy [_ cols data] | ||
(map #(json/generate-string % cheshire-opts) data)) | ||
(-render [_ cols data] | ||
(json/generate-string data cheshire-opts))) | ||
|
||
(defn make-renderer | ||
([] | ||
(make-renderer false)) | ||
([pretty] | ||
(->JSONRenderer {:pretty pretty}))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters