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(core): avoid never type on iif when no else #159

Merged
merged 5 commits into from
May 9, 2024

Conversation

rodrigo1991
Copy link
Contributor

Pull Request Template

PR Checklist

  • I have run npm test locally and all tests are passing.
  • I have added/updated tests for any new behavior.
  • I have added/updated documentation for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A, or add link to issue here]

PR Description

This pull request fixes the return types of iif not to force you to put a never third generic when not using elsePipeline

  • no need to put a never third input type when we don't provide an else pipeline as the third parameter
    before:
iif<string, string, never>(
  (notEmptyString) => notEmptyString!==''
  () => 'the string is not empty'
)
Screenshot 2024-05-09 at 12 40 48

now:

iif<string, string>(
  (notEmptyString) => notEmptyString!==''
  () => 'the string is not empty'
)

note that the this will not break the current code since the three parameters version of iif when not using elsePipeline will be marked as deprecated instead

@rodrigo1991 rodrigo1991 requested a review from a team as a code owner May 9, 2024 10:42
@franher franher changed the title Fix/iif return types fix(core): avoid never type on iif when no else May 9, 2024
Copy link
Contributor

@franher franher left a comment

Choose a reason for hiding this comment

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

LGTM

@franher franher merged commit b1cc160 into axa-group:main May 9, 2024
11 of 12 checks passed
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.

None yet

2 participants