Skip to content

fix(index): check options.decorateReply is a boolean#178

Merged
Fdawgs merged 3 commits into
masterfrom
Fdawgs-patch-1
Dec 4, 2024
Merged

fix(index): check options.decorateReply is a boolean#178
Fdawgs merged 3 commits into
masterfrom
Fdawgs-patch-1

Conversation

@Fdawgs
Copy link
Copy Markdown
Member

@Fdawgs Fdawgs commented Dec 4, 2024

The types state that the value should be a boolean, but the plugin is only checking if it is truthy.
This PR updates the if condition to explicitly check it is boolean.

Likewise, the PR updates the types to reflect that decorateReply is optional.

Checklist

@Fdawgs Fdawgs linked an issue Dec 4, 2024 that may be closed by this pull request
2 tasks
@Fdawgs Fdawgs requested a review from a team December 4, 2024 11:16
@jean-michelet
Copy link
Copy Markdown
Member

Dont know well this component but the condition you mention seems consistent with the current type, isn't it a simple boolean check?

@Fdawgs Fdawgs changed the title fix(types/index): correct decorateReply type fix(index): check options.decorateReply is a boolean Dec 4, 2024
@Fdawgs
Copy link
Copy Markdown
Member Author

Fdawgs commented Dec 4, 2024

Dont know well this component but the condition you mention seems consistent with the current type, isn't it a simple boolean check?

It was checking if it's truthy but not explicitly a boolean. Have just updated the PR with a fix to reflect that.

@Fdawgs Fdawgs requested a review from Copilot December 4, 2024 11:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (1)

index.js:41

  • The check should ensure that options.decorateReply is a boolean, not just true. Update the check to typeof options.decorateReply === 'boolean' && options.decorateReply.
if (options.decorateReply === true) {

@Fdawgs Fdawgs merged commit 0115450 into master Dec 4, 2024
@Fdawgs Fdawgs deleted the Fdawgs-patch-1 branch December 4, 2024 11:56
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type Error: No overload matches this call

3 participants