Tiny v1.0.0 Tiny
This module contains the entirely of the Tiny project. There are interface functions for encoding and decoding JSON, and little else.
Both encoding and decoding are done per the JSON specification with direct mapping between JSON types and Elixir types:
JSON Type | Elixir Type |
---|---|
Array | List |
Boolean | true or false |
Object | Map |
Number | Integer or Float |
String | Binary |
null | nil |
Numbers are parsed into Integer types when possible, falling back to Floats when required. This is due to functions which operate differently based on the numeric typing.
Summary
Functions
Safely decodes a JSON input binary to an Elixir term
Decodes a JSON inout binary to an Elixir term
Safely encodes a JSON compatible value to iodata or a binary
Encdoes a JSON compatible value to iodata or a binary
Types
Functions
Safely decodes a JSON input binary to an Elixir term.
Parsing errors are caught and an :error
Tuple is returned. Any successful
values are wrapped in an :ok
Tuple.
Decodes a JSON inout binary to an Elixir term.
Rather than return Tuples, this function will raise ArgumentError
on invalid
inputs. No information is provided beyond the error, so log context as needed.
Safely encodes a JSON compatible value to iodata or a binary.
Parsing errors are caught and an :error
Tuple is returned. Any successful
values are wrapped in an :ok
Tuple.
Encdoes a JSON compatible value to iodata or a binary.
Rather than return Tuples, this function will raise ArgumentError
on invalid
inputs. No information is provided beyond the error, so log context as needed.