ESModule distribution of the famous cycle.js from Douglas Crockford.
npm install json-cycle-esESModule distribution of the famous cycle.js from Douglas Crockford. This module exports two functions decycle and retrocycle. The implementation remains the same with slight modifications that should not alter the behavior of those functions.
``Javascript
import { decycle, retrocycle } from 'json-cycle-es';
const decycledObj = decycle(cyclicObj);
// or
const cyclicObj = retrocycle(decycledObj);
``
The additional arguments in the signature can be ignored and are only used for recusrive calls.
Public Domain
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.