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

Handle circular references #44

Closed
pcorpet opened this issue Jun 9, 2021 · 1 comment · Fixed by #47
Closed

Handle circular references #44

pcorpet opened this issue Jun 9, 2021 · 1 comment · Fixed by #47
Labels

Comments

@pcorpet
Copy link
Contributor

pcorpet commented Jun 9, 2021

The following code raises an error:

const loupe = require('loupe');
const a = {};
a['b'] = a;
loupe.inspect(a)

I would expect it to display:

{ b: [Circular] }

but for now it raises:

Uncaught RangeError: Maximum call stack size exceeded
    at _arrayWithHoles (./chai/node_modules/loupe/loupe.js:406:26)
    at _slicedToArray (./chai/node_modules/loupe/loupe.js:403:11)
    at inspectProperty (./chai/node_modules/loupe/loupe.js:625:16)
    at inspectList (./chai/node_modules/loupe/loupe.js:587:27)
    at inspectObject (./chai/node_modules/loupe/loupe.js:920:27)
    at Object.inspect (./chai/node_modules/loupe/loupe.js:1150:13)
    at inspectProperty (./chai/node_modules/loupe/loupe.js:636:20)
    at inspectList (./chai/node_modules/loupe/loupe.js:587:27)
    at inspectObject (./chai/node_modules/loupe/loupe.js:920:27)
    at Object.inspect (./chai/node_modules/loupe/loupe.js:1150:13)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

1 participant