Xema.Utils.to_existing_atom

You're seeing just the function to_existing_atom, go back to Xema.Utils module for more information.

Specs

to_existing_atom(String.t() | atom()) :: atom() | nil

Converts the given string to an existing atom. Returns nil if the atom does not exist.

Examples

  iex> import Xema.Utils
  iex> to_existing_atom(:my_atom)
  :my_atom
  iex> to_existing_atom("my_atom")
  :my_atom
  iex> to_existing_atom("not_existing_atom")
  nil