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

ojbect with circular reference causes isPojo to error out with 'maximum call stack exceeded' #7

Closed
chrisjameslennon opened this issue Mar 10, 2024 · 1 comment · Fixed by #8
Assignees

Comments

@chrisjameslennon
Copy link

    var obj = { a: 1, b: 2, c: [3, 4] };
    obj.c.push(obj);

    console.log(isPojo(obj))

This code (which has a circular reference at property c) errors out with
RangeError: Maximum call stack size exceeded at isAllowedJSONProperty (file://.../node_modules/@zerodep/is-pojo/esm.mjs:1:546)

@cdepage cdepage self-assigned this Mar 10, 2024
@cdepage
Copy link
Owner

cdepage commented Mar 10, 2024

Hi @chrisjameslennon,

I appreciate your time finding and reporting these issues!

v2.0.7 of @zerodep/is-pojo resolves this issue.

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

Successfully merging a pull request may close this issue.

2 participants