if/else -> ternary

This commit is contained in:
Cade Scroggins 2016-08-14 00:54:37 -07:00
parent 0c596f60f0
commit 92f4872ea7

View file

@ -240,11 +240,8 @@
return false;
}
if (q.match(new RegExp(urlRegex))) {
redirect = q;
} else {
redirect = config.defaultCommand + encodeURIComponent(q);
}
redirect = q.match(new RegExp(urlRegex)) ? q
: config.defaultCommand + encodeURIComponent(q);
config.commands.forEach(function(command) {
if (qSplit[0] === command.key) {