feat: improve type narrowing with assertion signature overloads#39
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds TypeScript overload sets and refinement hooks across all assertion functions in the library. Each assertion now accepts either a typed input ( ChangesAssertion library type-narrowing overhaul
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/assert/instance-of/instance-of.test.ts`:
- Line 89: Fix the typo in the test name for the test case that checks
structural intersection behavior. In the it() function call with the test
description, change "preservers" to "preserves" to correct the grammatical error
in the test name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 045e24f5-2c37-4a94-ad8a-fcf0cd5efebe
📒 Files selected for processing (57)
eslint.config.tsscripts/build-readme-lists.shsrc/assert/array-includes-all/array-includes-all.assert.tssrc/assert/array-includes-all/array-includes-all.match.tssrc/assert/array-includes-all/array-includes-all.test.tssrc/assert/array-includes-all/array-includes-all.type.tssrc/assert/array-includes/array-includes.assert.tssrc/assert/array-includes/array-includes.match.tssrc/assert/array-includes/array-includes.test.tssrc/assert/array-includes/array-includes.type.tssrc/assert/array-length/array-length.assert.tssrc/assert/array-length/array-length.test.tssrc/assert/array-min-length/array-min-length.assert.tssrc/assert/array-min-length/array-min-length.test.tssrc/assert/array-not-empty/array-not-empty.assert.tssrc/assert/array-not-empty/array-not-empty.test.tssrc/assert/array-not-empty/array-not-empty.type.tssrc/assert/buffer-equal/buffer-equal.test.tssrc/assert/identical/identical.assert.tssrc/assert/identical/identical.test.tssrc/assert/instance-of/instance-of.assert.tssrc/assert/instance-of/instance-of.match.tssrc/assert/instance-of/instance-of.test.tssrc/assert/instance-of/instance-of.type.tssrc/assert/non-nullable/non-nullable.match.tssrc/assert/non-nullable/non-nullable.test.tssrc/assert/non-nullable/non-nullable.type.tssrc/assert/number-to-nearest/number-to-nearest.test.tssrc/assert/object-equals/object-equals.test.tssrc/assert/object-has-property/object-has-property.assert.tssrc/assert/object-has-property/object-has-property.test.tssrc/assert/object-matches/object-matches.type.tssrc/assert/one-of/one-of.test.tssrc/assert/string-ends-with/string-ends-with.assert.tssrc/assert/string-ends-with/string-ends-with.test.tssrc/assert/string-includes/string-includes.assert.tssrc/assert/string-includes/string-includes.test.tssrc/assert/string-length/string-length.assert.tssrc/assert/string-length/string-length.test.tssrc/assert/string-not-includes/string-not-includes.assert.tssrc/assert/string-not-includes/string-not-includes.test.tssrc/assert/string-starts-with/string-starts-with.assert.tssrc/assert/string-starts-with/string-starts-with.test.tssrc/assert/true/true.test.tssrc/assert/type-bigint/type-bigint.test.tssrc/assert/type-boolean/type-boolean.test.tssrc/assert/type-function/type-function.test.tssrc/assert/type-number/type-number.test.tssrc/assert/type-numeric/type-numeric.test.tssrc/assert/type-object/type-object.test.tssrc/assert/type-string/type-string.test.tssrc/assert/type-symbol/type-symbol.test.tssrc/assert/type-typed-array/type-typed-array.test.tssrc/assert/undefined/undefined.test.tssrc/assert/uuid/uuid-v4.assert.tssrc/assert/uuid/uuid-v4.test.tssrc/assert/uuid/uuid-v4.type.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
expectTypeOf) and runtime error-message assertions.