Liking cljdoc? Tell your friends :D

com.wsscode.edn<->json


decode-keycljs

(decode-key s)
source

edn->jsoncljs

(edn->json x)
(edn->json x options)

Recursively transforms ClojureScript values to JavaScript.

The encoded JSON will have extra notation to enable a better deserialization later, keeping complex keys, keyword keys (simple and qualified), also encode extended types like UUID and dates. Using json->edn you can restore the original data from the JSON.

Some things that don't get restored:

  • metadata is lost
  • number keys on maps will be turned into strings on the conversion back

Other than that, all printable values should encode and decode with fidelity.

Recursively transforms ClojureScript values to JavaScript.

The encoded JSON will have extra notation to enable a better deserialization
later, keeping complex keys, keyword keys (simple and qualified), also encode
extended types like UUID and dates. Using json->edn you can restore the original
data from the JSON.

Some things that don't get restored:

- metadata is lost
- number keys on maps will be turned into strings on the conversion back

Other than that, all printable values should encode and decode with fidelity.
sourceraw docstring

encode-keycljs

(encode-key x)
source

js-obj?cljs

(js-obj? x)
source

json->edncljs

(json->edn x)
(json->edn x opts)

Recursively transforms JavaScript arrays into ClojureScript vectors, and JavaScript objects into ClojureScript maps.

Use to get fidelity restore of JSON data encoded with edn->json.

Recursively transforms JavaScript arrays into ClojureScript
vectors, and JavaScript objects into ClojureScript maps.

Use to get fidelity restore of JSON data encoded with edn->json.
sourceraw docstring

simple-js-type?cljs

(simple-js-type? x)

Return true for simple JS types. The intended use of this function is to detect if a value should be stored in its original form, for values that return false here, its expected that they get some encoding process before ending up as a JS value.

Return true for simple JS types. The intended use of this function is to detect if
a value should be stored in its original form, for values that return false here, its
expected that they get some encoding process before ending up as a JS value.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close