MapConverter

to_param_string/1

Convert atom_map to param_string

%{key1: value1, key2: value2}

"?key1=value1&key2=value2&"

atomize

Convert string_map to atom_map recursively.

%{
  "key1" => "value1",
  "child" => %{"child_key1" => "child_value2"}
}

%{
  key1: "value1",
  child: %{child_key1: => "child_value2"}
}

Installation

If available in Hex, the package can be installed by adding map_converter to your list of dependencies in mix.exs:

def deps do
  [
    {:lx, "~> 1.0.5"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/map_converter.