Skip to content

Commit

Permalink
chore: remove unnecessary arguments (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
is2ei authored May 23, 2022
1 parent 818ae5e commit e69f000
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ const separator = {
modifying: true,
valid: true,
errors: false,
compile: (schema) => (data, dataPath, parentData, parentDataProperty) => {
// In some cases parentData and parentDataProperty will be undefined.
// We need to fall back to the dataPath object to provide those values.
if (parentData && parentDataProperty) {
parentData[parentDataProperty] = data === '' ? [] : data.split(schema)
} else {
const {
parentData: pData,
parentDataProperty: pDataProperty
} = dataPath
pData[pDataProperty] = data === '' ? [] : data.split(schema)
}
compile: (schema) => (data, { parentData: pData, parentDataProperty: pDataProperty }) => {
pData[pDataProperty] = data === '' ? [] : data.split(schema)
}
}

Expand Down

0 comments on commit e69f000

Please sign in to comment.