dot-object
dot-object copied to clipboard
transform operation: include unmapped fields in target objet
It would be useful to find a way to copy the fields not present in the recipe object to the target object.
This way, if I have an object with 20 properties and I need to change only 5, I can make a recipe with only five entries.
This could be achieved with five move operations, but it's not that powerful.
An extra parameter in the transform function of maybe a final wildcard in the recipe could do the job, something like
const recipe = {
'p_key': 'email',
's_key': 'name',
'*': '*'};