Skip to content

Making tool parameters optional#6521

Merged
aiday-mar merged 1 commit intomainfrom
electoral-bedbug
Dec 9, 2024
Merged

Making tool parameters optional#6521
aiday-mar merged 1 commit intomainfrom
electoral-bedbug

Conversation

@aiday-mar
Copy link
Copy Markdown
Contributor

fixes #6422

@aiday-mar aiday-mar marked this pull request as ready for review December 9, 2024 15:25
@aiday-mar aiday-mar enabled auto-merge (squash) December 9, 2024 15:25
@aiday-mar aiday-mar requested a review from alexr00 December 9, 2024 15:25
@vs-code-engineering vs-code-engineering Bot added this to the February 2025 milestone Dec 9, 2024
Copy link
Copy Markdown
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this!

return `[${issue[column]}](${issue.url})`;
case 'labels':
return issue[column].map((label) => makeLabel(label)).join(', ');
return issue[column]?.map((label) => label && label.name && label.color ? makeLabel({ name: label.name, color: label.color }) : '').join(', ');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to leave out the label check like this.

Suggested change
return issue[column]?.map((label) => label && label.name && label.color ? makeLabel({ name: label.name, color: label.color }) : '').join(', ');
return issue[column]?.map((label) => label?.name && label.color ? makeLabel({ name: label.name, color: label.color }) : '').join(', ');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6523

@aiday-mar aiday-mar merged commit 9daab57 into main Dec 9, 2024
@aiday-mar aiday-mar deleted the electoral-bedbug branch December 9, 2024 17:09
@aiday-mar aiday-mar mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debt: mark all tool result return type fields as optional

2 participants