Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Aug 21, 2023
1 parent a2a082f commit fa31983
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handlers/dataHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa31983

Please sign in to comment.