Skip to content

Commit

Permalink
fix(core): fix move down throw errors and fix null assign merge throw…
Browse files Browse the repository at this point in the history
… errors (#961)
  • Loading branch information
janryWang authored Jul 12, 2020
1 parent 905aa97 commit 854feec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ export const createFormExternals = (
},
moveDown(index: number) {
const len = toArr(getValue()).length
return mutators.move(index, index + 1 > len ? 0 : index + 1)
return mutators.move(index, index + 1 >= len ? 0 : index + 1)
},
validate(opts?: IFormExtendedValidateFieldOptions) {
return validate(
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function propertyIsUnsafe(target, key) {

function mergeObject(target: any, source: any, options: Options) {
const destination = options.assign ? target : {}

if (!options.assign && options.isMergeableObject(target)) {
if (!options.isMergeableObject(target)) return target
if (!options.assign) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
})
Expand Down

0 comments on commit 854feec

Please sign in to comment.