From fa319838963dda4bc9cc723f143a00f28dca934c Mon Sep 17 00:00:00 2001 From: Birm Date: Mon, 21 Aug 2023 15:50:43 -0400 Subject: [PATCH] lint fix --- handlers/dataHandlers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/handlers/dataHandlers.js b/handlers/dataHandlers.js index 4e45258..dce2dc4 100644 --- a/handlers/dataHandlers.js +++ b/handlers/dataHandlers.js @@ -15,8 +15,10 @@ General.find = function(db, collection) { General.findWithRegex = function(db, collection) { return function(req, res, next) { var query = req.query; - for (let i in query){ - query[i] = new RegExp(query[i], 'i') // case insensitive search + for (let i in query) { + if (query.hasOwnProperty(i)) { + query[i] = new RegExp(query[i], 'i'); // case insensitive search + } } mongoDB.find(db, collection, query).then((x) => { req.data = x;