Open rafaeltp opened 9 years ago
Interesting! I see couple problems with current implementation of the ngraph.merge
, but that was intentional, as the old comment is saying:
// go deep, don't care about loops here, we are simple API!
I wonder maybe ngraph.merge
isn't the right library for your task? How are you going to merge arrays? I see in your test you expect to have two elements in the array, but what if both elements at index 0
have the same name - should they be merged to one?
First, just to give a bit of history: I notice the problem while trying to merge two objects with containers in it. The problem is that container have fields to both parents and children, which cause an infinity loop.
To keep it simple, but trying to reproduce the problem with accuracy, I re-wrote the goes deep test:
Which gives me the following error:
This is consistent with original issue.
PS: I'm not experienced in JavaScript, so I may not be doing some coding in an optimal way.