# is-cyclical

> Returns true if an array is cyclical at a specified value.

Latest version **0.2.2** (published 2016-07-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-cyclical
pnpm add is-cyclical
yarn add is-cyclical
bun add is-cyclical
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2016-07-08 |
| First published | 2016-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nick The Sick |
| Maintainers | nperez0111 |
| Keywords | npm, nodejs, array, cyclical, repeating, sequence |

## Links

- npm: https://www.npmjs.com/package/is-cyclical
- Repository: https://github.com/nperez0111/isCyclical
- Homepage: https://github.com/nperez0111/isCyclical#readme
- Issues: https://github.com/nperez0111/isCyclical/issues
- npm.io page: https://npm.io/package/is-cyclical

## Dependencies (1)

- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1

## Recent versions

- 0.2.2 (latest) — 2016-07-08
- 0.2.1 — 2016-07-08
- 0.2.0 — 2016-06-14
- 0.1.0 — 2016-06-14

## README

isCyclical
==========

Returns true if an array will continue to be cyclical if the value supplied is pushed onto it.

# Install

`npm install is-cyclical --save`

# Demo
````JS
var isCyclical = require('is-cyclical');

isCyclical( [ 1, 2, 3, 1, 2, 3 ], 1 )
//Returns true

//While

isCyclical( [ 1,2,3,4,1,2 ], 2)
//returns false because appending it to the array would break the cycle
````
If the array were [1,2,3,1,2,3] and the value added were 2 that would break the cycle therefore return false

## Deep Equality
`isCyclical.deepEquality` is initially set to true can be set to false to use an `==` test rather than a deep equality test

## Use Case

I made a game playing AI, in order for the AI to not fall into a loop of making the same moves I made this library so I know the next move will be different than the ones prior(No matter how long of a cycle of moves).

---
_Source: https://npm.io/package/is-cyclical · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
