Serializes and parses typed gleam/json values in JavaScript.
Represents a JSON parsing failure while preserving the JavaScript reason.
pub type JsonError {
InvalidJson(reason: String)
}
Constructors
-
InvalidJson(reason: String)
JavaScript rejected the supplied JSON text.
pub fn parse(from source: String) -> Result(json.Json, JsonError)
Parses JSON text into a typed JSON value.
pub fn stringify(value value: json.Json) -> String