Pleroma.Web.Metadata - tests

This commit is contained in:
Maksim 2019-07-12 16:42:54 +00:00 committed by kaniini
commit 92055941bd
5 changed files with 185 additions and 42 deletions

View file

@ -39,4 +39,11 @@ defmodule Pleroma.Web.Metadata.Utils do
"(@#{user.nickname})"
end
end
@spec fetch_media_type(list(String.t()), String.t()) :: String.t() | nil
def fetch_media_type(supported_types, media_type) do
Enum.find(supported_types, fn support_type ->
String.starts_with?(media_type, support_type)
end)
end
end