Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary arguments #122

Merged
merged 1 commit into from
May 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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