Skip to content

Commit

Permalink
refactor: add types to helper fns (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed May 8, 2024
1 parent 20d45db commit 2947c0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function isEnterpriseHost(hostname: string): boolean {
return !hostname.endsWith(Constants.DEFAULT_AUTH_OPTIONS.hostname);
}

export function getGitHubAPIBaseUrl(hostname) {
export function getGitHubAPIBaseUrl(hostname: string): string {
const isEnterprise = isEnterpriseHost(hostname);
return isEnterprise
? `https://${hostname}/api/v3`
Expand Down Expand Up @@ -60,7 +60,7 @@ export function generateNotificationReferrerId(
return buffer.toString('base64');
}

export function getCheckSuiteUrl(notification: Notification) {
export function getCheckSuiteUrl(notification: Notification): string {
let url = `${notification.repository.html_url}/actions`;
const filters = [];

Expand All @@ -87,7 +87,7 @@ export function getCheckSuiteUrl(notification: Notification) {
return url;
}

export function getWorkflowRunUrl(notification: Notification) {
export function getWorkflowRunUrl(notification: Notification): string {
let url = `${notification.repository.html_url}/actions`;
const filters = [];

Expand Down Expand Up @@ -197,7 +197,7 @@ export async function generateGitHubWebUrl(
return url;
}

export function formatForDisplay(text: string[]) {
export function formatForDisplay(text: string[]): string {
if (!text) {
return '';
}
Expand Down

0 comments on commit 2947c0a

Please sign in to comment.