What is the way to convert %{\"foo\" => \"bar\"} to %{foo: \"bar\"} in Elixir?
%{\"foo\" => \"bar\"}
%{foo: \"bar\"}
I think the easiest way to do this is to use Map.new:
Map.new
%{"a" => 1, "b" => 2} |> Map.new(fn {k, v} -> {String.to_atom(k), v} end) => %{a: 1, b: 2}