fix: Form getValue/setValue 使用 safeDeepClone 避免 File 等特殊对象克隆报错 - #2225
Merged
Merged
Conversation
- 将 Form.ts 中的 deepClone 替换为 safeDeepClone - safeDeepClone 对 File、Blob 等非普通对象保持引用而不做深拷贝 - 新增 safeDeepClone 工具函数的单元测试 - 新增 Form 含 File 值的集成测试 - 版本号升至 2.0.32-beta.10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
Form.ts中getValue()/setValue()使用的deepClone替换为safeDeepClonesafeDeepClone对File、Blob等非普通对象保持引用,不进行深拷贝,避免克隆报错safeDeepClone工具函数单元测试问题
当表单值中包含
File对象时,deepClone无法正确处理导致报错或数据丢失。测试
test/utils/safeDeepClone.spec.js— 覆盖基础类型、对象、数组、File/Blob 等场景test/src/Datum/Form.file.spec.js— 验证 Form setValue/getValue 处理含 File 的值