Cannot use 'in' operator to search for ... in null
zarmin opened this issue · comments
zarmin commented
const diff = require('microdiff').default
const a1 = {"a": { "b": 1 }}
const a2 = {"a": null}
console.log(diff(a1, a2))
/Users/.../node_modules/microdiff/dist/index.cjs:8
if (!(key in newObj)) {
^
TypeError: Cannot use 'in' operator to search for 'b' in null
Jacob Jackson commented
Thanks for reporting this! I will work on a fix, it should not take long.
Jacob Jackson commented
Ok, this should be fixed now. Let me know if you continue to have problems with this in version v1.1.1+.
Abdallah Abis commented
@AsyncBanana I'm having same issue in "microdiff": "^1.3.2"
Jacob Jackson commented
Could you send me the relevant code?