PassiveSupport.Map.safe_atomize_keys
You're seeing just the function
safe_atomize_keys
, go back to PassiveSupport.Map module for more information.
Link to this function
safe_atomize_keys(map)
Returns a map
with any string keys that safely coerced to existing atoms
I'm not giving y'all the ridiculously dangerous footgun of
wanton atom space pollution. I'm not some crazy, foot-shooting
cowboy, like Jason
.
Examples
iex> [:oh, :yay] # existing keys
iex> safe_atomize_keys(%{"oh" => "ooh", 'yay' => 'yaaay'})
%{oh: "ooh", yay: 'yaaay'}
iex> safe_atomize_keys(%{"oh" => "ooh", "noo" => "noooo"})
%{oh: "ooh"}