always return maps if the macro maps_always
is defined
This commit is contained in:
parent
8592742ded
commit
d4d838d4f4
2 changed files with 8 additions and 1 deletions
|
@ -69,9 +69,14 @@
|
|||
|
||||
-spec to_term(Source::binary(), Config::config()) -> json_value().
|
||||
|
||||
-ifdef(maps_always).
|
||||
to_term(Source, Config) when is_list(Config) ->
|
||||
(jsx:decoder(?MODULE, [return_maps] ++ Config, jsx_config:extract_config(Config)))(Source).
|
||||
-endif.
|
||||
-ifndef(maps_always).
|
||||
to_term(Source, Config) when is_list(Config) ->
|
||||
(jsx:decoder(?MODULE, Config, jsx_config:extract_config(Config)))(Source).
|
||||
|
||||
-endif.
|
||||
|
||||
parse_config(Config) -> parse_config(Config, #config{}).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue