You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more a question whether a feature like this would even be feasible to implement. What I need is mapping two values to one value, here a basic example:
input={first_name: 'Max',last_name: 'Mustermann'}# Now we want to map the full name# Option 1map(:first_name,to: :full_name).then{value + values.get(:last_name)}# Option 2to(:full_name).then{"#{values.get(:first_name)}#{values.get(:last_name]}"}
If one of the two doesn't exist, the mapper gets skipped, I would assume. If you use map? and one of them does not exist, then Undefined could be yielded (so if last_name does not exist, then value == ['Max', Undefined].
This and positional argument also takes a path, in case two different paths need to be walked:
I hope that's detailed enough :) Is it possible & feasible to implement a feature like this? Or would that mean basically having to rewrite everything?
Alternatively: Do you know of a better way of doing this, other than the two options I showed initially?
The text was updated successfully, but these errors were encountered:
This is more a question whether a feature like this would even be feasible to implement. What I need is mapping two values to one value, here a basic example:
What I would like to do is something like
If one of the two doesn't exist, the mapper gets skipped, I would assume. If you use
map?
and one of them does not exist, thenUndefined
could be yielded (so iflast_name
does not exist, thenvalue == ['Max', Undefined]
.This
and
positional argument also takes a path, in case two different paths need to be walked:I hope that's detailed enough :) Is it possible & feasible to implement a feature like this? Or would that mean basically having to rewrite everything?
Alternatively: Do you know of a better way of doing this, other than the two options I showed initially?
The text was updated successfully, but these errors were encountered: