mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-13 12:31:13 +00:00
Use Map.filter now that minimum Elixir version is 1.13
This commit is contained in:
parent
08a444f6c3
commit
010edcbcb5
1 changed files with 1 additions and 3 deletions
|
@ -20,15 +20,13 @@ defmodule Pleroma.Maps do
|
|||
end
|
||||
|
||||
def filter_empty_values(data) do
|
||||
# TODO: Change to Map.filter in Elixir 1.13+
|
||||
data
|
||||
|> Enum.filter(fn
|
||||
|> Map.filter(fn
|
||||
{_k, nil} -> false
|
||||
{_k, ""} -> false
|
||||
{_k, []} -> false
|
||||
{_k, %{} = v} -> Map.keys(v) != []
|
||||
{_k, _v} -> true
|
||||
end)
|
||||
|> Map.new()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue