if/else -> ternary
This commit is contained in:
+2
-5
@@ -240,11 +240,8 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q.match(new RegExp(urlRegex))) {
|
redirect = q.match(new RegExp(urlRegex)) ? q
|
||||||
redirect = q;
|
: config.defaultCommand + encodeURIComponent(q);
|
||||||
} else {
|
|
||||||
redirect = config.defaultCommand + encodeURIComponent(q);
|
|
||||||
}
|
|
||||||
|
|
||||||
config.commands.forEach(function(command) {
|
config.commands.forEach(function(command) {
|
||||||
if (qSplit[0] === command.key) {
|
if (qSplit[0] === command.key) {
|
||||||
|
|||||||
Reference in New Issue
Block a user