Skip to content

Commit

Permalink
refactor(get-app-authentication): make TS happy when passing an objec…
Browse files Browse the repository at this point in the history
…t property as undefined
  • Loading branch information
oscard0m committed Sep 24, 2024
1 parent 7d4e8a9 commit 81847ef
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/get-app-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ export async function getAppAuthentication({
timeDifference?: number;
}): Promise<AppAuthentication> {
try {
const appAuthentication = await githubAppJwt({
id: appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,
});
const appAuthentication = timeDifference
? await githubAppJwt({
id: appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,
})
: await githubAppJwt({
id: appId,
privateKey,
});

return {
type: "app",
Expand Down

0 comments on commit 81847ef

Please sign in to comment.