Try Install Learn Blog API Packages GitHub
Pages
core

Search
Entities

Json

Functions

parse
(
input
:
String
)
:
Result(String, Object)

Parses a string into an Object, returns Maybe.nothing() if the parsing failed.

Result.isOk(Json.parse("{}"))
Result.isError(Json.parse("{"))
prettyStringify
(
value
:
Object
spaces
:
Number
)

Pretty stringyfies the given object.

 Json.prettyStringify(`{ a: "Hello" }`, 2) == "{\n  \"a\": \"Hello\"\n}"
stringify
(
input
:
Object
)
:
String

Stringifies an Object into JSON string.

Json.stringify(`{ a: "Hello" }`) == "{ \"a\": \"Hello\" }"