Skip to content

Commit

Permalink
refactor(cloak): remove conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
BartOtten committed Dec 16, 2024
1 parent 45e69f3 commit 554a8ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/routex/extension/cloak.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ defmodule Routex.Extension.Cloak do

static =
if idx == 0 do
nil
[]
else
idx |> to_string()
[to_string(idx)]
end

path = ["/", dynamics || [], static || []] |> Path.join() |> Path.absname()
path = ["/", dynamics, static] |> Path.join() |> Path.absname()
cloak_map = Map.put_new(cloak_map, route.path, path)
route = %{route | path: path}

Expand Down

0 comments on commit 554a8ce

Please sign in to comment.