ToonEx.JSON (toon_ex v0.8.1)

Copy Markdown View Source

Transforms between JSON and TOON format.

Simply using Elixir JSON to transforms between JSON and TOON.

Example:

text =
"[4]:
  - 1
  - 2
  - hello
  - test:
      k1: 1"

json = ToonEx.JSON.from_toon!(text)
# "[1, 2, "hello ", {"test": {"k1": 1}}]"

Summary

Functions

from_toon(toon)

@spec from_toon(binary()) :: {:ok, binary()} | {:error, term()}

from_toon!(toon)

@spec from_toon!(binary()) :: binary()

to_toon(json)

@spec to_toon(binary()) :: {:ok, binary()} | {:error, term()}
@spec to_toon(binary()) :: binary()

to_toon!(json)