Simplify if else to make code easier to understand
This commit is contained in:
parent
bf16e91f24
commit
a26cc6b25c
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue