(decode-key s)
Decode string key to EDN, if key is not a string it is returned as is.
Decode string key to EDN, if key is not a string it is returned as is.
(decode-value x
{:com.wsscode.edn-json/keys [decode-edn-values?]
:or {decode-edn-values? true}})
(edn->json x)
(edn->json x
{:com.wsscode.edn-json/keys [encode-list-type?]
:or {encode-list-type? true}
:as opts})
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:
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.
(edn->json-like x)
(edn->json-like x
{:com.wsscode.edn-json/keys [encode-list-type?]
:or {encode-list-type? true}
:as opts})
Same as edn->json, but returns Clojure maps that are JSON friendly instead of the JSON directly. This is useful as a middle format if you need to later send it encoded as JSON.
Same as edn->json, but returns Clojure maps that are JSON friendly instead of the JSON directly. This is useful as a middle format if you need to later send it encoded as JSON.
(edn-value-str? x)
(encode-key x {:com.wsscode.edn-json/keys [encode-map-key]})
Encode map key, keywords numbers and strings are always encoded as strings. By
default encode other keys using the prefix __edn-key|
and the END encoded value.
If you provide ::encode-map-key, this will be used instead of the default encode.
Encode map key, keywords numbers and strings are always encoded as strings. By default encode other keys using the prefix `__edn-key|` and the END encoded value. If you provide ::encode-map-key, this will be used instead of the default encode.
(encode-value x {:com.wsscode.edn-json/keys [encode-value]})
Encode value representation, can be overwritten with the ::encode-value setting.
Encode value representation, can be overwritten with the ::encode-value setting.
(js-obj? x)
(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.
(json-like->edn x)
(json-like->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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close