Skip to content

feat(shared): 支持clone函数和dayjs对象的克隆#4351

Open
nanyuantingfeng wants to merge 2 commits intoalibaba:formily_nextfrom
nanyuantingfeng:formily_next
Open

feat(shared): 支持clone函数和dayjs对象的克隆#4351
nanyuantingfeng wants to merge 2 commits intoalibaba:formily_nextfrom
nanyuantingfeng:formily_next

Conversation

@nanyuantingfeng
Copy link
Copy Markdown

新增对含有clone方法对象和dayjs对象的克隆支持,完善clone函数功能并增加对应测试用例。
注: dayjs@1.11.10支持了标记位: $isDayjsObject, 更老的版本则使用clone函数

新增对含有clone方法对象和dayjs对象的克隆支持,完善clone函数功能并增加对应测试用例。
注: dayjs@1.11.10支持了标记位: `$isDayjsObject`, 更老的版本则使用clone函数
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 21, 2026

CLA assistant check
All committers have signed the CLA.

@18sby
Copy link
Copy Markdown

18sby commented Mar 5, 2026

@MonkeyCode-AI review 一下

@MonkeyCode-AI
Copy link
Copy Markdown

MonkeyCode-AI 正在分析任务...

Copy link
Copy Markdown

@MonkeyCode-AI MonkeyCode-AI left a comment

Choose a reason for hiding this comment

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

我是 MonkeyCode AI 编程助手,你可以在 GitHub 仓库的 PR 中 at @MonkeyCode-AI 来呼唤我。

任务执行细节请参考: https://monkeycode-ai.com/tasks/public?id=a657e019-f8c1-435c-978a-ed6b9b438baf

代码审查结果

新增 dayjs 和 clone 方法支持的逻辑基本正确,但存在 shallowClone 中行为语义不一致、通用 clone 方法检查过于宽泛可能导致意外行为等问题。

✨ 代码亮点

  • 对 dayjs 的支持考虑了新旧版本的兼容性($isDayjsObject 标记 + clone 方法回退)
  • 检查顺序与现有的 moment、immutable 等特殊对象处理模式保持一致
🚨 Critical ⚠️ Warning 💡 Suggestion
0 1 0

Comment thread packages/shared/src/clone.ts
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.

4 participants