Fix "Do not access Object.prototype method 'hasOwnProperty' from target object" eslint warnings

This commit is contained in:
Shreya 2021-04-12 17:30:17 +05:30
parent e74e205368
commit c736560f09
2 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ const getContents = (props) => {
// update existing state, not run-over
let prevRes = result;
for (let key in result) {
if (result.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(result, key)) {
prevRes[key] = result[key];
}
}

View File

@ -437,9 +437,9 @@ class ReportPageComponent extends AuthComponent {
isIssuePotentialSecurityIssue(issueName) {
let issueDescriptor = this.IssueDescriptorEnum[issueName];
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
return Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.TYPE) &&
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.WARNING &&
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.OVERVIEW);
}
getImmediateThreats() {
@ -476,9 +476,9 @@ class ReportPageComponent extends AuthComponent {
isIssueImmediateThreat(issueName) {
let issueDescriptor = this.IssueDescriptorEnum[issueName];
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
return Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.TYPE) &&
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.DANGER &&
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.OVERVIEW);
}
getImmediateThreatsOverviews() {
@ -598,7 +598,7 @@ class ReportPageComponent extends AuthComponent {
let issueDescriptor = this.IssueDescriptorEnum[issue.type];
let reportFnc = {};
if (issue.hasOwnProperty('credential_type') && issue.credential_type !== null) {
if (Object.prototype.hasOwnProperty.call(issue, 'credential_type') && issue.credential_type !== null) {
reportFnc = issueDescriptor[this.issueContentTypes.REPORT][issue.credential_type];
} else {
reportFnc = issueDescriptor[this.issueContentTypes.REPORT];