flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'options' of undefined

sh977218 opened this issue · comments

I believe there is bug here.
I have two object
obj1: { a:{ b:'b' } }
obj2: { b:'b' }

The code will throw error:
TypeError: Cannot read property 'options' of undefined

because obj2 does not have a when try to compare obj1's a.b

When I use your example objects in RunKit I get this result:

[
  {
    "kind": "D",
    "path": [
      "a"
    ],
    "lhs": {
      "b": "b"
    }
  },
  {
    "kind": "N",
    "path": [
      "b"
    ],
    "rhs": "b"
  }
]

Seems like there might be something else going on with your code.

I cannot reproduce this, closing it.