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

feat: handle empty string in displaystring pipe #2413

Closed
wants to merge 1 commit into from

Conversation

adisreyaj
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #2413 (eca3b49) into main (aed7549) will decrease coverage by 3.25%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2413      +/-   ##
==========================================
- Coverage   82.87%   79.62%   -3.25%     
==========================================
  Files         921      921              
  Lines       20543    20544       +1     
  Branches     3239     3240       +1     
==========================================
- Hits        17024    16358     -666     
- Misses       3394     4043     +649     
- Partials      125      143      +18     
Files Changed Coverage Δ
...rc/utilities/formatters/string/string-formatter.ts 51.85% <100.00%> (-48.15%) ⬇️

... and 90 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adisreyaj adisreyaj marked this pull request as ready for review September 19, 2023 10:59
@adisreyaj adisreyaj requested a review from a team as a code owner September 19, 2023 10:59
@github-actions
Copy link

Unit Test Results

       4 files  ±0     310 suites  ±0   47m 13s ⏱️ + 3m 32s
1 123 tests ±0  1 121 ✔️  - 2  0 💤 ±0  2 ❌ +2 
1 133 runs  ±0  1 131 ✔️  - 2  0 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit eca3b49. ± Comparison against base commit aed7549.

@@ -13,7 +15,7 @@ export const displayString = (provided?: unknown, defaultValueOnEmpty: string =
case 'function':
return 'Function';
case 'string':
return provided;
return !isEmpty(provided.trim()) ? provided : defaultValueOnEmpty;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know every place we use this pipe we want to treat empty string as undefined? Most places this is probably safe, but this seems like a risky change especially for something that feels like a caller bug.

@adisreyaj adisreyaj closed this Jun 3, 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.

4 participants