Skip to content

Commit

Permalink
Change object_finish normalization strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
williamthome committed Aug 8, 2024
1 parent f6c41bf commit be6005e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/exneus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,15 @@ defmodule Exneus do
|> Map.put(:object_finish, object_finish_decoder(Map.get(opts, :object_finish, :map)))
end

defp object_finish_decoder(:map) do
fn acc, old_acc -> {:maps.from_list(acc), old_acc} end
end

defp object_finish_decoder(:keyword_list) do
fn acc, old_acc -> {:lists.reverse(acc), old_acc} end
:proplist
end

defp object_finish_decoder(:reversed_keyword_list) do
fn acc, old_acc -> {acc, old_acc} end
:reversed_proplist
end

defp object_finish_decoder(decoder) when is_function(decoder, 2) do
defp object_finish_decoder(decoder) do
decoder
end
end

0 comments on commit be6005e

Please sign in to comment.