Skip to content

Commit

Permalink
refactor: adapt code for the exactOptionalPropertyTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Sep 24, 2024
1 parent c08cab4 commit 95114c8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Octokit as OctokitCore } from "@octokit/core";
import { Octokit as OctokitCore, type OctokitOptions } from "@octokit/core";
import { createAppAuth } from "@octokit/auth-app";
import { OAuthApp } from "@octokit/oauth-app";
import type { Webhooks } from "@octokit/webhooks";
Expand Down Expand Up @@ -99,11 +99,16 @@ export class App<TOptions extends Options = Options> {
: {},
);

this.octokit = new Octokit({
const octokitOptions: OctokitOptions = {
authStrategy: createAppAuth,
auth: authOptions,
log: options.log,
}) as OctokitType<TOptions>;
};

if ("log" in options && typeof options.log !== "undefined") {
octokitOptions.log = options.log;
}

this.octokit = new Octokit(octokitOptions) as OctokitType<TOptions>;

this.log = Object.assign(
{
Expand Down

0 comments on commit 95114c8

Please sign in to comment.