Get a JSON structure from a string generated by Debug.toString.
elm install f0i/debug-to-json
import DebugToJson
formatted =
{ asdf = "qwer" }
|> Debug.toString
|> DebugToJson.pp
formatted
will now contain the following String:
{
"asdf": "qwer"
}
A complete list of the helper functions can be found in the DebugToJson module docs.