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

Fix mapping of arrays with transform function #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Spencerhutch
Copy link

Within the original node-object mapper there is issue #77 where when applying a transformation to an array the previous value of the transformation will be passed to the input of the next iteration of the transform. This PR is a copy of an existing open PR to node-object-mapper that has been stagnant for a year.

@@ -115,7 +115,7 @@ async function updateArrIx(dest, ix, data, keys, context) {
typeof dest[ix] !== "undefined"
)
o = keys.length ? await update(dest[ix], data, keys, context) : data;
else o = keys.length ? await update(null, data, keys, context) : data;
else o = keys.length ? await update(null, data, keys, context) : applyTransform(data, dest, context);
Copy link
Owner

@rojasraul rojasraul Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Spencerhutch maybe the await statement is needed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants