PtcRunner.Kernel.JSONValue (PtcRunner v0.14.0)

Copy Markdown View Source

Internal validator for values that may cross JSON-shaped Kernel boundaries.

Accepted values are nil, booleans, finite numbers, valid UTF-8 binaries, lists, and non-struct maps with unique binary keys.

Summary

Functions

Returns whether a value is a JSON-like map.

Normalizes atom keys and values into a JSON-like value.

Returns whether a value is recursively JSON-like.

Functions

map?(value)

Returns whether a value is a JSON-like map.

normalize(value)

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

Normalizes atom keys and values into a JSON-like value.

value?(value)

Returns whether a value is recursively JSON-like.