wankdanker / node-object-mapper

Copy properties from one object to another.
MIT License
277 stars 73 forks source link

input from two attributes in transform object #56

Open gc1508 opened 5 years ago

gc1508 commented 5 years ago

In my use case, I am dealing with two array that I need to combine into one single array according to some conditional logics:

let input = { required: [ "name" ], properties: [ { id: "name" } ] }

let expected = { properties: [ { id: "name", required: true } ] }

How can I implement mapping logics that allow me to compare the two arrays, required vs properties?

THanks!