Fix: Lint no-prototype-builtins (#5920)
* Fix: Lint no-prototype-builtins Closes: https://github.com/parse-community/parse-server/issues/5842 Reference: https://eslint.org/docs/rules/no-prototype-builtins * replace Object.hasOwnProperty.call
This commit is contained in:
committed by
Antonio Davi Macedo Coelho de Castro
parent
4bffdce047
commit
cf6e79ee75
@@ -119,7 +119,7 @@ const validateQuery = (
|
||||
*/
|
||||
Object.keys(query).forEach(key => {
|
||||
const noCollisions = !query.$or.some(subq =>
|
||||
Object.hasOwnProperty.call(subq, key)
|
||||
Object.prototype.hasOwnProperty.call(subq, key)
|
||||
);
|
||||
let hasNears = false;
|
||||
if (query[key] != null && typeof query[key] == 'object') {
|
||||
@@ -1487,7 +1487,7 @@ class DatabaseController {
|
||||
[key]: userPointer,
|
||||
};
|
||||
// if we already have a constraint on the key, use the $and
|
||||
if (query.hasOwnProperty(key)) {
|
||||
if (Object.prototype.hasOwnProperty.call(query, key)) {
|
||||
return { $and: [q, query] };
|
||||
}
|
||||
// otherwise just add the constaint
|
||||
|
||||
Reference in New Issue
Block a user