Skip to content

Commit

Permalink
refactor: simplify function signature in createLabel
Browse files Browse the repository at this point in the history
Condensed parameter declarations into a single line for readability.
  • Loading branch information
gentlementlegen committed Nov 2, 2024
1 parent aac510e commit a144021
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/shared/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ export async function listLabelsForRepo(context: ContextPlugin): Promise<Label[]
throw context.logger.error("Failed to fetch lists of labels", { status: 500 });
}

export async function createLabel(
context: ContextPlugin,
name: string,
labelType = "default" as keyof typeof COLORS,
description: string | undefined
): Promise<void> {
export async function createLabel(context: ContextPlugin, name: string, labelType = "default" as keyof typeof COLORS, description?: string): Promise<void> {
const payload = context.payload;

const color = name.startsWith("Price: ") ? COLORS.price : COLORS[labelType];
Expand Down

0 comments on commit a144021

Please sign in to comment.