Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cypress/what-is-circular

Package Overview
Dependencies
Maintainers
10
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/what-is-circular

Like is-circular, but returns the path to the first circular reference found.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by160%
Maintainers
10
Weekly downloads
 
Created
Source

what-is-circular Build Status

Like 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

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 for providing the tests and README for this project.

Thanks to @angus-c's just-is-circular for contributing additional tests.

FAQs

Package last updated on 14 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc