Skip to content

Commit

Permalink
mix format
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceful-james committed Nov 18, 2024
1 parent 4a94cb4 commit ab36268
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/kanta/cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ defmodule Kanta.Cache do
# this old way is just broken for preloads lists
# encoded_list = (Enum.into(val, %{}) |> URI.encode_query())
# the new way is robust and reversible
encoded_list = val |> :erlang.term_to_binary() |> URI.encode() |> then(&%{encoded_params: &1}) |> URI.encode_query()
encoded_list =
val
|> :erlang.term_to_binary()
|> URI.encode()
|> then(&%{encoded_params: &1})
|> URI.encode_query()

acc <> "_" <> to_string(key) <> "_" <> encoded_list

_val ->
Expand Down

0 comments on commit ab36268

Please sign in to comment.