Skip to content

Commit 7319050

Browse files
author
Awlex
committed
add clauses to allow for normal lists
1 parent d2fc185 commit 7319050

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/kaffy/resource_schema.ex

+2
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@ defmodule Kaffy.ResourceSchema do
317317
end
318318

319319
defp pretty_list([]), do: ""
320+
defp pretty_list([item] = list) when not is_binary(item), do: list
320321
defp pretty_list([item]), do: to_string(item)
322+
defp pretty_list([a | _rest] = list) when not is_binary(a), do: list
321323
defp pretty_list([a, b]), do: "#{a} and #{b}"
322324
defp pretty_list([a, b, c]), do: "#{a}, #{b} and #{c}"
323325
defp pretty_list([a, b, c, d]), do: "#{a}, #{b}, #{c} and #{d}"

0 commit comments

Comments
 (0)