mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
33 lines
641 B
Markdown
33 lines
641 B
Markdown
# is-circular [](https://travis-ci.org/tjmehta/is-circular) [](http://standardjs.com/)
|
|
|
|
High-performance circular reference check for objects (or arrays) w/ no dependencies
|
|
|
|
# Installation
|
|
|
|
`npm install is-circular`
|
|
|
|
# Usage
|
|
|
|
```js
|
|
var isCircular = require('is-circular')
|
|
|
|
var circularObj = {
|
|
foo: 1,
|
|
bar: 2
|
|
}
|
|
circularObj.qux = circularObj
|
|
|
|
isCircular(circularObj) // true
|
|
|
|
var obj = {
|
|
foo: 1,
|
|
bar: 2,
|
|
qux: 3
|
|
}
|
|
|
|
isCircular(obj) // false
|
|
```
|
|
|
|
# License
|
|
MIT
|