We had code like:
const messageWithNewProp = (message) => ({
...message,
newProp: 'newValue'
})
Then we discovered that when spreading a message
object, not all the properties get copied to the new object. Specifically, the url
property is lost on a file message.
We’re assuming that the url
prop was created with something like: Object.defineProperty(message, 'url', { value: 'http://etc' })
.
Is something like this happening, that’s causing the url property to not have a enumerable: true
attribute for the object?