Skip to content

refactor: simplify the implementation of isNullish#989

Merged
tbouffard merged 2 commits intomainfrom
refactor/simplify_isNullish
Jan 9, 2026
Merged

refactor: simplify the implementation of isNullish#989
tbouffard merged 2 commits intomainfrom
refactor/simplify_isNullish

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Jan 7, 2026

Tests have been added before changing the implementation to ensure that no regression occurs.

Summary by CodeRabbit

  • New Features

    • Introduced a utility to detect null or undefined values.
  • Tests

    • Added tests validating the new null/undefined utility alongside existing tests.

✏️ Tip: You can customize this high-level summary in your review settings.

Tests have been added before changing the implementation to ensure that no regression occurs.
@tbouffard tbouffard added the refactor Code refactoring label Jan 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Walkthrough

Adds and exports isNullish(value: any): boolean in packages/core/src/internal/utils.ts, implemented using v == undefined. Tests in packages/core/__tests__/internal/utils.test.ts were added to assert true for null/undefined and false for common non-nullish values.

Changes

Cohort / File(s) Summary
Utility export
packages/core/src/internal/utils.ts
Added and exported isNullish(value: any): boolean implemented as v == undefined
Tests
packages/core/__tests__/internal/utils.test.ts
Imported isNullish and added tests asserting true for null/undefined and false for other values; existing matchBinaryMask tests unchanged

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and lacks required information from the template, including overview details, issue reference, and rationale for the change. Add a comprehensive overview explaining what problem the refactoring solves, include an issue reference (closes #xxxx), provide rationale for simplifying v === null || v === undefined to v == undefined, and confirm all PR checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: simplifying the implementation of the isNullish function through refactoring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/simplify_isNullish

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea96130 and 01260b6.

📒 Files selected for processing (1)
  • packages/core/__tests__/internal/utils.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/core/tests/internal/utils.test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build
  • GitHub Check: build (macos-14)
  • GitHub Check: build (windows-2022)
  • GitHub Check: build (ubuntu-24.04)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

@tbouffard tbouffard merged commit 0c1f90b into main Jan 9, 2026
11 checks passed
@tbouffard tbouffard deleted the refactor/simplify_isNullish branch January 9, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant