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:
Diamond Lewis
2019-08-14 16:57:00 -05:00
committed by Antonio Davi Macedo Coelho de Castro
parent 4bffdce047
commit cf6e79ee75
22 changed files with 145 additions and 64 deletions

View File

@@ -600,7 +600,10 @@ class ParseLiveQueryServer {
) {
return false;
}
if (!request || !request.hasOwnProperty('masterKey')) {
if (
!request ||
!Object.prototype.hasOwnProperty.call(request, 'masterKey')
) {
return false;
}
return request.masterKey === validKeyPairs.get('masterKey');
@@ -623,7 +626,7 @@ class ParseLiveQueryServer {
_handleSubscribe(parseWebsocket: any, request: any): any {
// If we can not find this client, return error to client
if (!parseWebsocket.hasOwnProperty('clientId')) {
if (!Object.prototype.hasOwnProperty.call(parseWebsocket, 'clientId')) {
Client.pushError(
parseWebsocket,
2,
@@ -699,7 +702,7 @@ class ParseLiveQueryServer {
notifyClient: boolean = true
): any {
// If we can not find this client, return error to client
if (!parseWebsocket.hasOwnProperty('clientId')) {
if (!Object.prototype.hasOwnProperty.call(parseWebsocket, 'clientId')) {
Client.pushError(
parseWebsocket,
2,