Current section
Files
Jump to
Current section
Files
lib/crawlberg/favicon_info.ex
# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:06831f8166c6d860691af36ee02b72ae3246568eb2e5c67ed5d11da71d02afeb
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Crawlberg.FaviconInfo do
@moduledoc "Information about a favicon or icon link."
@typedoc "Information about a favicon or icon link."
@type t :: %__MODULE__{
url: String.t() | nil,
rel: String.t() | nil,
sizes: String.t() | nil,
mime_type: String.t() | nil
}
defstruct url: nil,
rel: nil,
sizes: nil,
mime_type: nil
defimpl Jason.Encoder do
@doc false
def encode(value, opts) do
value
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> v == nil end)
|> Enum.into(%{})
|> Jason.Encoder.encode(opts)
end
end
end