Open tony-oldport opened 3 years ago
This works:
const map = {
'plans[].services': {
key: '[]',
transform: (sourceValue, sourceObject, destinationObject) => {
sourceValue.forEach(val => {
destinationObject.push(val.svcId)
})
}
}
}
But only if I add && typeof o !== 'undefined'
to the if statement in this line:
Trying to dig in and understand why there is no undefined check there currently.
The result without the undefined check is: [undefined, undefined, 300]
Apologies if there's an obvious answer to this. I think I've tried to do it every possible way except for the correct way.
If I have the following source object:
How can I map this to return an array of the service IDs?
[100, 200, 300]