Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

Fdawgs
Copy link
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

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
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

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
13 checks passed
@Fdawgs Fdawgs deleted the Fdawgs-patch-1 branch December 4, 2024 11:56
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.

Type Error: No overload matches this call
2 participants