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) {
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue