Skip to content

refactor(sdk-metrics): remove isNotNullish() utility function#6151

Merged
pichlermarc merged 4 commits intoopen-telemetry:mainfrom
cjihrig:not-nullish
Nov 24, 2025
Merged

refactor(sdk-metrics): remove isNotNullish() utility function#6151
pichlermarc merged 4 commits intoopen-telemetry:mainfrom
cjihrig:not-nullish

Conversation

@cjihrig
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig commented Nov 21, 2025

Which problem is this PR solving?

isNotNullish(x) essentially implements x != null, and it is only used in one place other than a test.

Fixes # N/A

Short description of the changes

This commit replaces isNotNullish() with equivalent JavaScript syntax.

Type of change

None of these. Performance/maintenance refactor.

How Has This Been Tested?

  • Test suite.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@cjihrig cjihrig requested a review from a team as a code owner November 21, 2025 20:26
Comment thread CHANGELOG.md Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.40%. Comparing base (82e01bc) to head (692174f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6151      +/-   ##
==========================================
- Coverage   95.40%   95.40%   -0.01%     
==========================================
  Files         317      317              
  Lines        9428     9427       -1     
  Branches     2178     2178              
==========================================
- Hits         8995     8994       -1     
  Misses        433      433              
Files with missing lines Coverage Δ
packages/sdk-metrics/src/state/MeterSharedState.ts 98.33% <100.00%> (+0.02%) ⬆️
packages/sdk-metrics/src/utils.ts 98.27% <ø> (-0.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

thanks!

@pichlermarc pichlermarc added this pull request to the merge queue Nov 24, 2025
Merged via the queue into open-telemetry:main with commit 141d009 Nov 24, 2025
27 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot bot commented Nov 24, 2025

Thank you for your contribution @cjihrig! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@cjihrig cjihrig deleted the not-nullish branch November 24, 2025 12:52
@otelbot-js otelbot-js bot mentioned this pull request Jan 7, 2026
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.

2 participants