On a deep merge of an Immutable object, properties that have a file are not being replaced. An example of the current behavior:
var oldObj = Immutable({ file: new File([''], 'oldFile') })
var newObj = oldObj.merge({ file: new File([''], 'newFile') }, { deep: true })
console.log(newObj.file.name) // outputs ==> ’oldFile’
I would expect the old file to be replaced with the new file. In looking at the code, the merge function attempts to to merge the two files which fails because Object.getOwnPropertyDescriptor returns undefined for a File’s properties. Updating isMergableObject to check if the object is a File or Blob would fix this issue. Happy to put up a PR if that approach seems reasonable.
On a deep merge of an Immutable object, properties that have a file are not being replaced. An example of the current behavior:
I would expect the old file to be replaced with the new file. In looking at the code, the
merge
function attempts to to merge the two files which fails becauseObject.getOwnPropertyDescriptor
returnsundefined
for a File’s properties. UpdatingisMergableObject
to check if the object is a File or Blob would fix this issue. Happy to put up a PR if that approach seems reasonable.