# what-is-circular **Repository Path**: mirrors_cypress-io/what-is-circular ## Basic Information - **Project Name**: what-is-circular - **Description**: Like is-circular, but returns the path to the first circular reference found. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2025-11-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # what-is-circular [![Build Status](https://travis-ci.org/cypress-io/what-is-circular.svg?branch=master)](https://travis-ci.org/cypress-io/what-is-circular) Like [`is-circular`](https://github.com/tjmehta/is-circular/), but returns the path to the first circular reference found. # Installation `npm install @cypress/what-is-circular` # Usage ## `whatIsCircular(obj)` Returns an array that contains the path to the first circular reference found, or `undefined` if no circular reference is found. # Example ```js var whatIsCircular = require('@cypress/what-is-circular') var circularObj = { foo: 1, bar: 2 } // qux.baz is the circular reference circularObj.qux = { baz: circularObj } whatIsCircular(circularObj) // ['qux', 'baz'] var obj = { foo: 1, bar: 2, qux: 3 } whatIsCircular(obj) // undefined ``` # License MIT # Thanks Thanks to @tjmehta's [`is-circular`](https://github.com/tjmehta/is-circular/) for providing the tests and README for this project. Thanks to @angus-c's [`just-is-circular`](https://github.com/angus-c/just/) for contributing additional tests.