Skip to content

Commit 854feec

Browse files
authored
fix(core): fix move down throw errors and fix null assign merge throw errors (#961)
1 parent 905aa97 commit 854feec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/core/src/externals.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ export const createFormExternals = (
10411041
},
10421042
moveDown(index: number) {
10431043
const len = toArr(getValue()).length
1044-
return mutators.move(index, index + 1 > len ? 0 : index + 1)
1044+
return mutators.move(index, index + 1 >= len ? 0 : index + 1)
10451045
},
10461046
validate(opts?: IFormExtendedValidateFieldOptions) {
10471047
return validate(

packages/shared/src/merge.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ function propertyIsUnsafe(target, key) {
9090

9191
function mergeObject(target: any, source: any, options: Options) {
9292
const destination = options.assign ? target : {}
93-
94-
if (!options.assign && options.isMergeableObject(target)) {
93+
if (!options.isMergeableObject(target)) return target
94+
if (!options.assign) {
9595
getKeys(target).forEach(function(key) {
9696
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
9797
})

0 commit comments

Comments
 (0)