Skip to content

Commit

Permalink
add alias Plug.Upload to make the Struct available to the atomize_map…
Browse files Browse the repository at this point in the history
…_keys/1 function #49 + #52
  • Loading branch information
nelsonic committed Aug 15, 2023
1 parent df22d96 commit 728975b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/useful.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ defmodule Useful do
def atomize_map_keys(%Time{} = value), do: value
def atomize_map_keys(%DateTime{} = value), do: value
def atomize_map_keys(%NaiveDateTime{} = value), do: value
# Avoid Plug.Upload.__struct__/0 is undefined compilation error useful/issues#52
alias Plug.Upload
def atomize_map_keys(%Plug.Upload{} = value), do: value

# handle lists in maps: github.com/dwyl/useful/issues/46
Expand Down

0 comments on commit 728975b

Please sign in to comment.