Commit a26cc6b2 authored by Clement Ho's avatar Clement Ho

Simplify if else to make code easier to understand

parent bf16e91f
...@@ -137,11 +137,12 @@ ...@@ -137,11 +137,12 @@
if (token.wildcard && condition) { if (token.wildcard && condition) {
tokenPath = condition.url; tokenPath = condition.url;
} else if (!token.wildcard) { } else if (token.wildcard) {
// Remove the wildcard token // wildcard means that the token does not have a symbol
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value.slice(1))}`;
} else {
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value)}`; tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value)}`;
} else {
// Remove the token symbol
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value.slice(1))}`;
} }
paths.push(tokenPath); paths.push(tokenPath);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment