var O=function(v,f){f||(f={}),typeof f=="function"&&(f={cmp:f});var s=typeof f.cycles=="boolean"?f.cycles:!1,l=f.cmp&&function(u){return function(r){return function(i,t){var c={key:i,value:r[i]},n={key:t,value:r[t]};return u(c,n)}}}(f.cmp),e=[];return function u(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);var i,t;if(Array.isArray(r)){for(t="[",i=0;i<r.length;i++)i&&(t+=","),t+=u(r[i])||"null";return t+"]"}if(r===null)return"null";if(e.indexOf(r)!==-1){if(s)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var c=e.push(r)-1,n=Object.keys(r).sort(l&&l(r));for(t="",i=0;i<n.length;i++){var a=n[i],y=u(r[a]);if(!y)continue;t&&(t+=","),t+=JSON.stringify(a)+":"+y}return e.splice(c,1),"{"+t+"}"}(v)};export default O;
