diff --git a/lib/handlers/on-search.js b/lib/handlers/on-search.js index 1a97422a..c889de41 100644 --- a/lib/handlers/on-search.js +++ b/lib/handlers/on-search.js @@ -220,14 +220,10 @@ module.exports = server => (mailbox, options, session, callback) => { break; } let entry = !op - ? [ - { - $gte: value - }, - { - $lt: new Date(value.getTime() + 24 * 3600 * 1000) - } - ] + ? { + $gte: value, + $lt: new Date(value.getTime() + 24 * 3600 * 1000) + } : { [op]: value }; @@ -263,14 +259,10 @@ module.exports = server => (mailbox, options, session, callback) => { break; } let entry = !op - ? [ - { - $gte: value - }, - { - $lt: new Date(value.getTime() + 24 * 3600 * 1000) - } - ] + ? { + $gte: value, + $lt: new Date(value.getTime() + 24 * 3600 * 1000) + } : { [op]: value };