A utility to detect and handle circular references in objects.
npm install find-circular
import { findCircular } from "find-circular";
const obj = { a: 1 };
obj.self = obj;
console.log(findCircular(obj));
// Output: { a: 1, self: "[Circular]" }
You can find the source code and contribute to the project on GitHub: