Browse Source

bump(version): 0.0.42 and drop if not a string.

jackyalcine 9 months ago
parent
commit
04d1df09da
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D
2 changed files with 14 additions and 11 deletions
  1. 10
    7
      lib/indieweb/hcard.ex
  2. 4
    4
      mix.exs

+ 10
- 7
lib/indieweb/hcard.ex View File

@@ -203,15 +203,18 @@ defmodule IndieWeb.HCard do
203 203
       end
204 204
     end)
205 205
     |> Map.put_new_lazy("photo", fn ->
206
-      photo =
207
-        Microformats2.Utility.get_value(hcard, :photo, []) |> List.first()
206
+      photo = Microformats2.Utility.get_value(hcard, :photo, []) |> List.first()
208 207
 
209
-      photo_uri = cond do
210
-        is_map(photo) == true -> Microformats2.Utility.get_value(photo, :url, []) |> List.first
211
-        true -> photo
212
-      end
208
+      photo_uri =
209
+        cond do
210
+          is_map(photo) == true ->
211
+            Microformats2.Utility.get_value(photo, :url, []) |> List.first()
212
+
213
+          true ->
214
+            photo
215
+        end
213 216
 
214
-      if !is_nil(photo_uri) do
217
+      if !is_nil(photo_uri) and is_binary(photo_uri) do
215 218
         IndieWeb.Http.make_absolute_uri(photo_uri, host)
216 219
       else
217 220
         nil

+ 4
- 4
mix.exs View File

@@ -7,7 +7,7 @@ defmodule IndieWeb.MixProject do
7 7
       aliases: aliases(),
8 8
       app: :indieweb,
9 9
       name: "IndieWeb",
10
-      version: "0.0.41",
10
+      version: "0.0.42",
11 11
       elixir: "~> 1.7",
12 12
       elixirc_paths: elixirc_paths(Mix.env()),
13 13
       start_permanent: Mix.env() == :prod,
@@ -41,11 +41,11 @@ defmodule IndieWeb.MixProject do
41 41
   defp deps do
42 42
     [
43 43
       {:apex, "~> 1.2.1", only: [:dev, :test]},
44
-      {:cachex, "~> 3.1"},
44
+      {:cachex, "~> 3.1.0"},
45 45
       {:credo, "~> 1.0.0", only: [:dev, :test]},
46 46
       {:excoveralls, "~> 0.10.0", only: [:test]},
47
-      {:ex_doc, "~> 0.14", only: :dev},
48
-      {:exvcr, "~> 0.10", only: :test},
47
+      {:ex_doc, "~> 0.14.0", only: :dev},
48
+      {:exvcr, "~> 0.10.0", only: :test},
49 49
       {:faker, "~> 0.12.0", only: :test},
50 50
       {:inch_ex, github: "rrrene/inch_ex", only: [:dev, :test]},
51 51
       {:microformats2, "~> 0.2.0"}

Loading…
Cancel
Save