Skip to content

Commit

Permalink
PR: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhya-spend committed Nov 22, 2024
1 parent 445c877 commit fbdc376
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ let defaultGetSnapshot = form => F.flattenObject(toJS(gatherFormValues(form)))
let defaultGetNestedSnapshot = form => F.unflattenObject(form.getSnapshot())

// Splice the form errors when a array item is removed
const spliceErrors = (errors, parent, nodePosition) => {
const parentPath = parent.join('.')
const parentLength = parent.length
const arrayErrors = pickByPrefixes([parentPath], errors)
const newErrors = omitByPrefixes([parentPath], errors)
const spliceErrors = (errors, parentPath, nodePosition) => {
const parent = parentPath.join('.')
const parentLength = parentPath.length
const arrayErrors = pickByPrefixes([parent], errors)
const newErrors = omitByPrefixes([parent], errors)
for (const [key, value] of Object.entries(arrayErrors)) {
const keyFields = key.split('.')
const idx = parseInt(keyFields[parentLength])
Expand Down

0 comments on commit fbdc376

Please sign in to comment.