Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.where(key, conditions[key]);
});
}
if (is.string(key)) {
// if only one argument was supplied
// save the key in this.lastKey
// for future methods, like .equals()
if (is.undefined(value)) {
this.lastKey = key;
return this;
}
// if value is a regular expression
// use $regex modifier
if (is.regexp(value)) {
value = { $regex: value };
}
this.query[key] = value;
}
return this;
}
});
})();
}
if (is.string(key)) {
// if only one argument was supplied
// save the key in this.lastKey
// for future methods, like .equals()
if (is.undefined(value)) {
this.lastKey = key;
return this;
}
// 1. if regular expression
// 2. if object and not ObjectID
if (is.regexp(value)) {
value = { $regex: value };
} else if (is.object(value) && !isObjectID(value)) {
value = { $elemMatch: value };
}
this.query[key] = value;
}
return this;
};
Interceptor.prototype[method] = function (path) {
this.method = method;
this.path = is.regexp(path) ? path : pathToRegExp(path);
return this;
};
});
Interceptor.prototype[method] = function (path) {
this.method = method;
this.path = is.regexp(path) ? path : pathToRegExp(path);
return this;
};
});