Syrup format encoder and decoder
- Gleam 100%
| src | ||
| test | ||
| .gitignore | ||
| gleam.toml | ||
| LICENSE | ||
| manifest.toml | ||
| README.md | ||
| zoo.bin | ||
gleerup
Simple Syrup encoder and decoder for Gleam.
gleam add gleerup
import gleerup
pub fn main() -> Nil {
let input = <<"{3\"age30+4\"name5\"Alice7\"another[1+2+3+]7\"isAlivet}">>
let result = gleerup.decode(input) |> default_value
assert gleerup.dictionary(
dict.from_list([
#(gleerup.str("age"), gleerup.int(30)),
#(gleerup.str("name"), gleerup.str("Alice")),
#(
gleerup.str("another"),
gleerup.sequence([
gleerup.int(1),
gleerup.int(2),
gleerup.int(3),
]),
),
#(gleerup.str("isAlive"), gleerup.bool(True)),
]),
)
== result
}
Further documentation can be found at https://hexdocs.pm/gleerup.
Development
gleam run # Run the project
gleam test # Run the tests