diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-05-23 20:58:28 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-05-23 20:58:28 +0300 |
commit | 529594ef5594a1ef23048b751ddd27e0956f2ebb (patch) | |
tree | c21167cf03aab5cfbefb473db1df2b7c0f6f428a /client | |
parent | 3d1f004e902e9a1648d9b9a0401dffd8a61d7ec2 (diff) | |
download | wekan-529594ef5594a1ef23048b751ddd27e0956f2ebb.tar.gz wekan-529594ef5594a1ef23048b751ddd27e0956f2ebb.tar.bz2 wekan-529594ef5594a1ef23048b751ddd27e0956f2ebb.zip |
Fix lint errors.
Diffstat (limited to 'client')
-rw-r--r-- | client/lib/filter.js | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/client/lib/filter.js b/client/lib/filter.js index 416f2019..fa139cfe 100644 --- a/client/lib/filter.js +++ b/client/lib/filter.js @@ -163,27 +163,27 @@ class AdvancedFilter { if (commands[i].cmd) { switch (commands[i].cmd) { case '(': - { - level++; - if (start === -1) start = i; - continue; - } + { + level++; + if (start === -1) start = i; + continue; + } case ')': - { - level--; + { + level--; + commands.splice(i, 1); + i--; + continue; + } + default: + { + if (level > 0) { + subcommands.push(commands[i]); commands.splice(i, 1); i--; continue; } - default: - { - if (level > 0) { - subcommands.push(commands[i]); - commands.splice(i, 1); - i--; - continue; - } - } + } } } } @@ -205,86 +205,86 @@ class AdvancedFilter { case '=': case '==': case '===': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': str }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': str }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case '!=': case '!==': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $not: str } }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $not: str } }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case '>': case 'gt': case 'Gt': case 'GT': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gt: str } }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gt: str } }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case '>=': case '>==': case 'gte': case 'Gte': case 'GTE': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gte: str } }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gte: str } }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case '<': case 'lt': case 'Lt': case 'LT': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lt: str } }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lt: str } }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case '<=': case '<==': case 'lte': case 'Lte': case 'LTE': - { - const field = commands[i - 1].cmd; - const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lte: str } }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const field = commands[i - 1].cmd; + const str = commands[i + 1].cmd; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lte: str } }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } } } @@ -300,44 +300,44 @@ class AdvancedFilter { case 'OR': case '|': case '||': - { - const op1 = commands[i - 1]; - const op2 = commands[i + 1]; - commands[i] = { $or: [op1, op2] }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const op1 = commands[i - 1]; + const op2 = commands[i + 1]; + commands[i] = { $or: [op1, op2] }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case 'and': case 'And': case 'AND': case '&': case '&&': - { - const op1 = commands[i - 1]; - const op2 = commands[i + 1]; - commands[i] = { $and: [op1, op2] }; - commands.splice(i - 1, 1); - commands.splice(i, 1); - //changed = true; - i--; - break; - } + { + const op1 = commands[i - 1]; + const op2 = commands[i + 1]; + commands[i] = { $and: [op1, op2] }; + commands.splice(i - 1, 1); + commands.splice(i, 1); + //changed = true; + i--; + break; + } case 'not': case 'Not': case 'NOT': case '!': - { - const op1 = commands[i + 1]; - commands[i] = { $not: op1 }; - commands.splice(i + 1, 1); - //changed = true; - i--; - break; - } + { + const op1 = commands[i + 1]; + commands[i] = { $not: op1 }; + commands.splice(i + 1, 1); + //changed = true; + i--; + break; + } } } |