json escape to_json and format by default
This commit is contained in:
parent
7c810cb05d
commit
fa173e2d11
1 changed files with 2 additions and 2 deletions
|
@ -39,13 +39,13 @@
|
|||
-spec to_json(Source::any(), Opts::opts()) -> binary().
|
||||
|
||||
to_json(Source, Opts) when is_list(Opts) ->
|
||||
(jsx:encoder(?MODULE, Opts, jsx_utils:extract_opts([json_escape] ++ Opts)))(Source).
|
||||
(jsx:encoder(?MODULE, Opts, jsx_utils:extract_opts(Opts ++ [json_escape])))(Source).
|
||||
|
||||
|
||||
-spec format(Source::binary(), Opts::opts()) -> binary().
|
||||
|
||||
format(Source, Opts) when is_binary(Source) andalso is_list(Opts) ->
|
||||
(jsx:decoder(?MODULE, Opts, jsx_utils:extract_opts([json_escape] ++ Opts)))(Source).
|
||||
(jsx:decoder(?MODULE, Opts, jsx_utils:extract_opts(Opts ++ [json_escape])))(Source).
|
||||
|
||||
|
||||
parse_opts(Opts) -> parse_opts(Opts, #opts{}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue