0.0.20 • Published 5 years ago

@rxluz/prevent-object-recursion v0.0.20

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@rxluz/prevent-object-recursion

➰ Remove all recursive references from the object

Build Status codecov Commitizen friendly npm.io npm.io npm.io

Usage

Example (es module)

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)

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 installed, run

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

Acknowledgments

  • This project was inspired by a chat in NodeJS Brasil Telegram Group.
  • rxluz

See Also

License

MIT

0.0.20

5 years ago

0.0.19

5 years ago

0.0.17

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago