Skip to content

Optionally, replace circular references with the key it points to #1

Open
@binyamin

Description

@binyamin

Currently, circular references are each replaced with the string [Circular]. It would be helpful to identify which key the circular reference points to.

const foo = {a: true};
foo.b = foo.a;

console.log(safeStringify(foo));
//=> '{ "a": true, "b": "[Circular]" }'

console.log(safeStringify(foo, { trace: true } ));
//=> '{ "a": true, "b": "[Circular *a]" }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions