Skip to content

Commit

Permalink
fix: if atom doesn't exist when unflattening map, create it
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Aug 26, 2022
1 parent 506b230 commit d8d1c38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/iteraptor/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ defmodule Iteraptor.Utils do
def smart_convert(value) do
case value |> to_string() |> Integer.parse() do
{value, ""} -> value
_ -> String.to_existing_atom(value)
_ -> try do String.to_existing_atom(value) rescue ArgumentError -> String.to_atom(value) end
end
end

Expand Down

0 comments on commit d8d1c38

Please sign in to comment.