Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break cycles #17

Open
mindplay-dk opened this issue Apr 17, 2018 · 4 comments
Open

Break cycles #17

mindplay-dk opened this issue Apr 17, 2018 · 4 comments

Comments

@mindplay-dk
Copy link

Comparing two object graphs with cycles sends this library into recursive tail-spin.

Having tested for this issue with both deep-equal, fast-deep-equal and deep-eql, I found that the only library where this works, is deep-eql, so you might consider referencing their approach.

If you don't wish to support object graphs with cycles, perhaps this should be explicitly omitted and noted in the documentation, since it creates pretty serious issues in test-frameworks etc.?

@epoberezkin
Copy link
Owner

epoberezkin commented Apr 17, 2018

I don't mind supporting cycles with some extra option, as long as it doesn't affect performance in the main use case (it can be difficult though). Documenting would definitely be helpful.

You could try using https://www.npmjs.com/package/cyclical-json but you will need to fork to create stable order for keys.

@mindplay-dk
Copy link
Author

I ended up using deep-eql - I was just reporting the issue to make it known, like a good citizen ;-)

@epoberezkin
Copy link
Owner

In branch cycles

@macrozone
Copy link

In branch cycles

would be cool to have this feature! do you consider doing a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants