LiveSvelteGettext.JSON (LiveSvelteGettext v0.2.0)
View SourceMinimal JSON encoding that does not force a particular library on consumers.
LiveSvelte made Jason optional in 0.17.0 and defaults to Erlang's built-in
:json module (OTP 27+). Hard-requiring Jason here would drag it back into
applications that have deliberately dropped it, so we pick an encoder in this
order:
- the module configured as
config :live_svelte_gettext, :json_library Jason, if it is loaded:jsonfrom OTP 27+
The payload is a plain map of strings, so any of these produce identical output.
Summary
Functions
Encodes data as a JSON string.