basketball-website

This commit is contained in:
2023-12-19 22:28:56 -05:00
parent 2465a18235
commit f324155864
11 changed files with 606 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
defmodule BasketballWebsite do
def extract_from_path(data, path) do
path
|> String.split(".")
|> get_path(data)
end
defp get_path(_list, nil), do: nil
defp get_path([], data), do: data
defp get_path([head | tail], data), do: get_path(tail, data[head])
def get_in_path(data, path) do
get_in(data, String.split(path, "."))
end
end