always return maps if the macro maps_always is defined

This commit is contained in:
alisdair sullivan 2014-12-18 15:58:19 -08:00
parent 8592742ded
commit d4d838d4f4
2 changed files with 8 additions and 1 deletions

View file

@ -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{}).