# @rxluz/prevent-object-recursion

> Remove all recursive references from the object

Latest version **0.0.20** (published 2019-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rxluz/prevent-object-recursion
pnpm add @rxluz/prevent-object-recursion
yarn add @rxluz/prevent-object-recursion
bun add @rxluz/prevent-object-recursion
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.20 |
| Published | 2019-02-12 |
| First published | 2019-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.9 |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ricardo Luz |
| Maintainers | rxluz |
| Keywords | js, json, object, recursion |

## Links

- npm: https://www.npmjs.com/package/@rxluz/prevent-object-recursion
- Repository: https://github.com/rxluz/prevent-object-recursion
- Homepage: https://github.com/rxluz/prevent-object-recursion#readme
- Issues: https://github.com/rxluz/prevent-object-recursion/issues
- npm.io page: https://npm.io/package/@rxluz/prevent-object-recursion

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.20 (latest) — 2019-02-12
- 0.0.19 — 2019-02-12
- 0.0.17 — 2019-02-12
- 0.0.15 — 2019-02-11
- 0.0.14 — 2019-02-11
- 0.0.13 — 2019-02-11
- 0.0.12 — 2019-02-10
- 0.0.11 — 2019-02-10
- 0.0.10 — 2019-02-10
- 0.0.9 — 2019-02-10
- 0.0.2 — 2019-02-10
- 0.0.1 — 2019-02-09

## README

# @rxluz/prevent-object-recursion

> ➰ Remove all recursive references from the object

[![Build Status](https://travis-ci.org/rxluz/prevent-object-recursion.svg?branch=master)](https://travis-ci.org/rxluz/prevent-object-recursion)
[![codecov](https://codecov.io/gh/rxluz/prevent-object-recursion/branch/master/graph/badge.svg)](https://codecov.io/gh/rxluz/prevent-object-recursion)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
![](https://img.shields.io/bundlephobia/min/@rxluz/prevent-object-recursion.svg?style=flat)
![](https://img.shields.io/npm/v/@rxluz/prevent-object-recursion.svg?style=flat)
![](https://img.shields.io/npm/l/@rxluz/prevent-object-recursion.svg?style=flat)

## Usage

### Example (es module)

```js
import preventObjectRecursion from '@rxluz/prevent-object-recursion';

const a = { hello: 'world' };
const b = { hey: 'hey', hello: a };
a.newProp = b;

console.log(preventObjectRecursion(a));
// => { hello: 'world', newProp: { hey: 'hey' }}
```

### Example (commonjs)

```js
var preventObjectRecursion = require('@rxluz/prevent-object-recursion').default;

const a = { hello: 'world' };
const b = { hey: 'hey', hello: a };
a.newProp = b;

console.log(preventObjectRecursion(a));
// => { hello: 'world', newProp: { hey: 'hey' }}
```

## Install

With [npm](https://npmjs.org/) installed, run

```
$ npm i @rxluz/prevent-object-recursion --save
```

## Acknowledgments

- This project was inspired by a chat in NodeJS Brasil Telegram Group.
- [rxluz](https://github.com/rxluz)

## See Also

- [Project documentation](https://rxluz.github.io/prevent-object-recursion/)
- [Dev.to platform post about this project](https://dev.to/ricardo/i-wrote-an-npm-package-to-prevent-infinite-recursion-in-objects-5422)

## License

MIT

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