Simplify if else to make code easier to understand

This commit is contained in:
Clement Ho 2016-12-12 23:16:45 -06:00
parent bf16e91f24
commit a26cc6b25c
1 changed files with 5 additions and 4 deletions

View File

@ -137,11 +137,12 @@
if (token.wildcard && condition) {
tokenPath = condition.url;
} else if (!token.wildcard) {
// Remove the wildcard token
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value.slice(1))}`;
} else {
} else if (token.wildcard) {
// wildcard means that the token does not have a symbol
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value)}`;
} else {
// Remove the token symbol
tokenPath = `${token.key}_${param}=${encodeURIComponent(token.value.slice(1))}`;
}
paths.push(tokenPath);