Repository navigation
Conversation
|
@Aminark is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review.
|
| 层 / 文件 | 摘要 |
|---|---|
空剩余路径的删除处理 src/utils/set.ts, tests/utils.test.ts |
internalSet 在剩余路径为空时删除当前副本中的目标属性,并保留原有的末级路径删除逻辑。测试覆盖字符串键、Symbol 键和数组索引,并验证源对象或数组未改变。 |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to d11ae
-
The change correctly removes requested properties while preserving the source object or array.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
我是小兔,轻敲键盘忙,
字符属性悄悄离开场。Symbol 键也能被删去,
数组留着空槽不摇晃。
原来的值仍安然无恙,
月光下我抱着胡萝卜欢唱。
Comment @coderabbitai help to get the list of available commands.
set({ a: 1 }, ['a'], undefined, true)leaves an own property namedainstead of deleting it. Nested paths already remove the property.Handle the final path segment directly, including symbol keys and array entries. The added tests check that the source is unchanged and deleting an array entry keeps its length.
All 32 test suites pass (231 tests, 1 existing skip). The three new cases fail before the fix. TypeScript, changed-file lint, and the package build pass.
Summary by CodeRabbit
undefined删除顶层属性时,目标对象会正确移除该属性,原对象保持不变。