fix: preserve branded primitive values - #810
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough本次变更更新 ChangesRecursivePartial 类型修复
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR preserves branded primitive types without changing runtime form behavior or deployment characteristics. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #810 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 20 20
Lines 1329 1329
Branches 309 309
=======================================
Hits 1323 1323
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary\n\n- treat primitive values as RecursivePartial leaf types\n- preserve branded and nominal string, number, bigint, boolean, and symbol values\n- add a compile-time regression for a branded domain ID\n\n## Problem\n\nRecursivePartial currently checks the object branch before recognizing branded primitives. A branded string therefore gets recursively mapped over its object-like keys instead of remaining the original domain type. This is the behavior reported in #390 and it still reproduces with the current TypeScript 6 toolchain.\n\nThe new type assertion fails on the exact base with Type true is not assignable to type false, then passes when primitives are retained as leaves. Object, array, readonly array, Date, RegExp, Function, Map, and Set behavior is unchanged.\n\nFixes #390.\n\n## Verification\n\n- exact-base type regression reproduced\n- TypeScript no-emit check passed\n- focused type-check suite: 4/4 tests passed\n- full suite: 24/24 suites, 203 passed and 1 skipped\n- ESM, CJS, and declaration build passed\n- ESLint has zero errors and only existing unused-disable warnings\n- Prettier and diff checks passed\n\nAI assistance disclosure: Codex helped construct the type-level reproduction, trace the conditional type behavior, implement the scoped guard, and run verification.
Summary by CodeRabbit
改进
测试