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): fix iif return types #152

Merged
merged 4 commits into from
May 8, 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 fix the return types of iif

  • 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'
)

now:

iif<string, string>(
  (notEmptyString) => notEmptyString!==''
  () => 'the string is not empty'
)
  • when we use an else pipeline as the third parameter the returned type will never be mapped as the input first parameter on typescrit
    having the following:
iif<boolean, string, string>(
      (condition) => condition,
      () => 'if',
      () => 'else'
    ),
    (result) => {...}

before:
Screenshot 2024-05-07 at 21 04 12
now:
Screenshot 2024-05-07 at 21 04 51

@rodrigo1991 rodrigo1991 requested a review from a team as a code owner May 7, 2024 19:09
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

@@ -1,6 +1,6 @@
{
"name": "@axa/bautajs-core",
"version": "3.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

please, the package.json version is something managed by the CICD; revert this change.

@franher franher merged commit a9f2d2c into axa-group:main May 8, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants