purescript-json
purescript-json copied to clipboard
Object Insert Issue
The documentation for JSON.Object.insert states that it will overwrite values for the existing keys, but it is not overwriting, you have to delete the key manually before inserting an existing key.
I think the issue is that the underlying method used (assign) does not actually overwrite existing keys:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
Definitely a bug :+1:, thanks!
Probably should be implemented as Object.assign({}, obj, { [k]: v }); instead, or maybe by property assignment after cloning the object.