Use an undefined check rather than hasOwnProperty.

This commit is contained in:
Chris Gavin 2020-11-02 08:47:11 +00:00
parent 1220ae5bfd
commit 1f7bae7ab8
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 3 additions and 6 deletions

2
lib/api-client.js generated
View file

@ -33,7 +33,7 @@ exports.getApiClient = function (githubAuth, githubUrl, mode, allowLocalRun = fa
const customOctokit = githubUtils.GitHub.plugin(retry.retry, (octokit, _) => {
octokit.hook.after("request", (response, _) => {
if (!hasBeenWarnedAboutVersion &&
Object.prototype.hasOwnProperty.call(response.headers, GITHUB_ENTERPRISE_VERSION_HEADER)) {
response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] !== undefined) {
const installedVersion = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER];
const disallowedAPIVersionReason = apiVersionInRange(installedVersion, apiCompatibility.minimumVersion, apiCompatibility.maximumVersion);
const logger = mode === "actions"