|> Enum.filter(&String.ends_with?(&1, ".ex"))
|> Enum.map(fn filename ->
module = filename |> String.trim_trailing(".ex") |> Macro.camelize()
- String.to_existing_atom(start <> module)
+ String.to_atom(start <> module)
end)
end
end
entity
|> Map.put(:suggestions, format_suggestions(suggestions))
|> format_key()
+ |> format_group()
|> format_children()
end
defp format_child(entity) do
entity
|> format_key()
+ |> format_group()
|> format_children()
end
+ defp format_group(%{group: group} = entity) do
+ Map.put(entity, :group, format_suggestion(group))
+ end
+
+ defp format_group(entity), do: entity
+
defp atom_to_string(entity) when is_binary(entity), do: entity
defp atom_to_string(entity) when is_atom(entity), do: inspect(entity)