From fbaad5e335ea4450eda7bc087aea369837f81014 Mon Sep 17 00:00:00 2001 From: Led Date: Sat, 14 Oct 2017 03:53:05 +0300 Subject: [PATCH] jsx_to_term: fix parsing 'return_maps' option --- src/jsx_to_term.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jsx_to_term.erl b/src/jsx_to_term.erl index aa05264..e5a15d0 100644 --- a/src/jsx_to_term.erl +++ b/src/jsx_to_term.erl @@ -86,9 +86,8 @@ parse_config([{labels, Val}|Rest], Config) parse_config(Rest, Config#config{labels = Val}); parse_config([labels|Rest], Config) -> parse_config(Rest, Config#config{labels = binary}); -parse_config([{return_maps, Val}|Rest], Config) - when Val == true; Val == false -> - parse_config(Rest, Config#config{return_maps = true}); +parse_config([{return_maps, Val}|Rest], Config) when is_boolean(Val) -> + parse_config(Rest, Config#config{return_maps = Val}); parse_config([return_maps|Rest], Config) -> parse_config(Rest, Config#config{return_maps = true}); parse_config([{K, _}|Rest] = Options, Config) ->