defmodule Playwright.Extra.Atom do @moduledoc false def from_string(nil), do: raise(ArgumentError, message: "Unable to convert nil into an atom") def from_string(s) when is_binary(s), do: String.to_atom(s) def from_string(a) when is_atom(a), do: a def to_string(nil), do: raise(ArgumentError, message: "Unable to convert nil into a string") def to_string(a) when is_atom(a), do: Atom.to_string(a) def to_string(s) when is_binary(s), do: s def snakecased(s) when is_binary(s), do: Recase.to_snake(s) |> from_string() end