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

Option to limit depth/recursion? #21

Open
abtincbrians opened this issue Sep 1, 2015 · 3 comments
Open

Option to limit depth/recursion? #21

abtincbrians opened this issue Sep 1, 2015 · 3 comments

Comments

@abtincbrians
Copy link

For certain large objects, such as a Superagent response, prettyjson produces the following error message: "RangeError: Maximum call stack size exceeded".

I tried looking through the available options, but I didn't see anything immediately jumping out at me that would allow me to limit the depth or level of recursion that's happening within prettyjson. If the option isn't available, then perhaps this is a feature request.

@rafeca
Copy link
Owner

rafeca commented Sep 16, 2015

Exactly, this option is not currently available, but looks like a nice feature to have, I'll try to implement it in the near future

Thanks for the feature request!

@walkermalling
Copy link

This error occurs with such low levels of recursion that I suspect there might be something else at work.

Are you by chance assigning an object to another object's key before passing the parent object to prettyjson?

@bnadim
Copy link

bnadim commented Nov 10, 2016

Hi, I was working on adding support for depth as find this library great but then i realised there was issues with recursivity also.
Finally i decided to make a whole new projet that is based on the work done here but completely rewritten to remove recursivity, add max depth and improve performances.
You can find it here https://github.com/keepitcool/prettyoutput

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

No branches or pull requests

4 participants