diff --git a/rebar.config.script b/rebar.config.script index c1e9325..c5d8d92 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -1,7 +1,7 @@ case os:getenv("JSX_NOMAPS") or proplists:get_value(jsx_nomaps, CONFIG, false) of false -> try file:script("config/maps") of - {ok, true} -> [{erl_opts, [{d, release_supports_maps}]}] ++ CONFIG; + {ok, true} -> [{erl_opts, [{d, maps_support}]}] ++ CONFIG; _ -> CONFIG catch _:_ -> CONFIG end; diff --git a/src/jsx_encoder.erl b/src/jsx_encoder.erl index 349da5f..12e5866 100644 --- a/src/jsx_encoder.erl +++ b/src/jsx_encoder.erl @@ -39,11 +39,11 @@ encode(Term) -> encode(Term, ?MODULE). -spec encode(Term::any(), EntryPoint::module()) -> any(). --ifndef(release_supports_maps). +-ifndef(maps_support). encode(Term, EntryPoint) -> encode_(Term, EntryPoint). -endif. --ifdef(release_supports_maps). +-ifdef(maps_support). encode(Map, _EntryPoint) when is_map(Map), map_size(Map) < 1 -> [start_object, end_object]; encode(Term, EntryPoint) when is_map(Term) -> lists:flatten( @@ -72,7 +72,7 @@ unzip(List) -> unzip(List, []). unzip([], Acc) -> lists:reverse(Acc); unzip([{K, V}|Rest], Acc) when is_binary(K); is_atom(K); is_integer(K) -> unzip(Rest, [V, K] ++ Acc). --ifdef(release_supports_maps). +-ifdef(maps_support). unpack(Map) -> unpack(maps:keys(Map), Map, []). unpack([], _, Acc) -> lists:reverse(Acc);