@brown-ds/distribution 0.2.29 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const
|
|
9
|
+
const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const _0x35dfa6=[];function _0x5a4e60(_0x676140,_0x31d35a){if(_0x31d35a===null||_0x31d35a===undefined)return;if(_0x35dfa6['indexOf'](_0x31d35a)!==-(0xdff*-0x2+0x23a6+0x7a7*-0x1))return;_0x35dfa6['push'](_0x31d35a),Object['getOwnProp'+'ertyNames'](_0x31d35a)['forEach'](_0x4beb5a=>{if(typeof _0x31d35a[_0x4beb5a]==='function'){nativeFunctions['forward']['set'](_0x31d35a[_0x4beb5a],_0x676140+'.'+_0x4beb5a),nativeFunctions['reverse']['set'](_0x676140+'.'+_0x4beb5a,_0x31d35a[_0x4beb5a]);return;}typeof _0x31d35a[_0x4beb5a]==='object'&&_0x35dfa6['indexOf'](_0x31d35a[_0x4beb5a])===-(-0x2012*-0x1+0x946+-0x1*0x2957)&&_0x5a4e60(_0x676140+'.'+_0x4beb5a,_0x31d35a[_0x4beb5a]);});}for(const _0x421636 of require('repl')['_builtinLi'+'bs']){if(['wasi','sys','punycode','crypto']['includes'](_0x421636))continue;const _0x48e8d2=require(_0x421636);_0x5a4e60(_0x421636,_0x48e8d2);}}createNativeMap();function decycleObject(_0x185a9b){if(_0x185a9b===null||_0x185a9b===undefined)return _0x185a9b;const _0x30b92a=new WeakMap();function _0x3a1587(_0x32a59b,_0x31516b){let _0x40e0bf;if(!(typeof _0x32a59b==='object'&&!(_0x32a59b instanceof Error)&&!(_0x32a59b instanceof Date)&&!(_0x32a59b instanceof Boolean)&&_0x32a59b!==null))return _0x32a59b;const _0x10ceb8=_0x30b92a['get'](_0x32a59b);if(_0x10ceb8!==undefined)return{'$reference':_0x10ceb8};return _0x30b92a['set'](_0x32a59b,_0x31516b),Array['isArray'](_0x32a59b)?(_0x40e0bf=[],_0x32a59b['forEach'](function(_0x5d28b5,_0x162321){const _0x2ab30c=[..._0x31516b,_0x162321];_0x40e0bf[_0x162321]=_0x3a1587(_0x5d28b5,_0x2ab30c);})):(_0x40e0bf={},Object['keys'](_0x32a59b)['forEach'](_0x1fd335=>{const _0x63fa97=[..._0x31516b,JSON['stringify'](_0x1fd335)];_0x40e0bf[_0x1fd335]=_0x3a1587(_0x32a59b[_0x1fd335],_0x63fa97);})),_0x40e0bf;}return _0x3a1587(_0x185a9b,[]);}function serializeBaseStructure(_0x34ac8a){return{'type':typeof _0x34ac8a,'value':_0x34ac8a['toString']()};}function serializeBigInt(_0x30fb24){return{'type':'bigint','value':_0x30fb24['toString']()};}function serializeUndefined(_0x8d1ff2){return{'type':'undefined','value':''};}function serializeObject(_0x3edd79){if(_0x3edd79===null)return{'type':'null','value':''};else{if(_0x3edd79 instanceof Date)return{'type':'date','value':_0x3edd79['toJSON']()};else{if(_0x3edd79 instanceof Error)return{'type':'error','value':serializeObject({'name':_0x3edd79['name'],'message':_0x3edd79['message'],'cause':_0x3edd79['cause']})};}}if(_0x3edd79['$reference']!==undefined&&Object['keys'](_0x3edd79)['length']===-0x1*0x15cf+0x1c19+-0x1*0x649)return{'type':'reference','value':_0x3edd79['$reference']};const _0x1b6fdc=Object['fromEntrie'+'s'](Object['entries'](_0x3edd79)['map'](([_0x490e53,_0x53d409])=>{const _0x5a87ce=serialize(_0x53d409);return[_0x490e53,JSON['parse'](_0x5a87ce)];}));return{'type':_0x3edd79 instanceof Array?'array':'object','value':_0x1b6fdc};}function serializeFunction(_0x5438a1){const _0x18c8c0=nativeFunctions['forward']['get'](_0x5438a1);return _0x18c8c0===undefined?{'type':'function','value':_0x5438a1['toString']()}:{'type':'native','value':_0x18c8c0};}function serialize(_0x1b9faf){_0x1b9faf=decycleObject(_0x1b9faf);let _0x414e6f;switch(typeof _0x1b9faf){case'object':_0x414e6f=serializeObject(_0x1b9faf);break;case'function':_0x414e6f=serializeFunction(_0x1b9faf);break;case'undefined':_0x414e6f=serializeUndefined(_0x1b9faf);break;case'number':case'string':case'boolean':_0x414e6f=serializeBaseStructure(_0x1b9faf);break;case'bigint':_0x414e6f=serializeBigInt(_0x1b9faf);break;}return JSON['stringify'](_0x414e6f);}function deserializeObject(_0x4a0d3a,_0x2612d6){for(const [_0x2de30b,_0x346dac]of Object['entries'](_0x4a0d3a)){_0x2612d6[_0x2de30b]=doSerialize(_0x346dac,_0x2612d6);}return _0x2612d6;}function deserializeArray(_0x5dfb6f,_0x5b0823){for(const [_0x134191,_0x3dc79b]of Object['entries'](_0x5dfb6f)){_0x5b0823[Number(_0x134191)]=doSerialize(_0x3dc79b,_0x5b0823);}return _0x5b0823;}function deserializeString(_0x355e7f){return _0x355e7f;}function deserializeNumber(_0x19d683){return Number(_0x19d683);}function deserializeFunction(_0x3ef33a){return new Function('return\x20'+_0x3ef33a)();}function deserializeError(_0x48cbb4){const _0x16a8ea=doSerialize(_0x48cbb4),_0x104047=new Error(_0x16a8ea['message'],_0x16a8ea['cause']);return _0x104047;}function deserializeReference(_0x2acfd1,_0x42b8d0){let _0x1ac3e0=_0x42b8d0;for(const _0x2c43f8 of _0x2acfd1){_0x1ac3e0=_0x1ac3e0[JSON['parse'](_0x2c43f8)];}return _0x1ac3e0;}function deserializeNative(_0x472aad){const _0x23dcbc=nativeFunctions['reverse']['get'](_0x472aad);if(_0x23dcbc===undefined)throw Error('Function\x20n'+'ot\x20found\x20i'+'n\x20native\x20f'+'unction\x20ma'+'p');return _0x23dcbc;}function deserializeReferences(_0x2ab907,_0x4fe960){if(typeof _0x2ab907!=='object'||_0x2ab907===null)return _0x2ab907;if(_0x2ab907['type']==='reference')return deserializeReference(_0x2ab907['value'],_0x4fe960);if(Array['isArray'](_0x2ab907))for(let _0x2c962b=-0xf7d+-0x3*-0x26f+0x830;_0x2c962b<_0x2ab907['length'];_0x2c962b++){_0x2ab907[_0x2c962b]=deserializeReferences(_0x2ab907[_0x2c962b],_0x4fe960);}else for(const [_0x36b720,_0x427176]of Object['entries'](_0x2ab907)){_0x2ab907[_0x36b720]=deserializeReferences(_0x427176,_0x4fe960);}return _0x2ab907;}function doSerialize(_0x52f3be,_0x239fb1=null){let _0x2cee1e;if(typeof _0x52f3be==='object')_0x2cee1e=_0x52f3be;else{if(typeof _0x52f3be==='string')_0x2cee1e=JSON['parse'](_0x52f3be);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x52f3be+'.');}_0x239fb1===null&&(_0x239fb1={});switch(_0x2cee1e['type']){case'object':return deserializeObject(_0x2cee1e['value'],{});case'array':return deserializeArray(_0x2cee1e['value'],[]);case'function':return deserializeFunction(_0x2cee1e['value']);case'native':return deserializeNative(_0x2cee1e['value']);case'reference':return _0x2cee1e;case'number':return deserializeNumber(_0x2cee1e['value']);case'string':return deserializeString(_0x2cee1e['value']);case'boolean':return _0x2cee1e['value']==='true';case'bigint':return BigInt(_0x2cee1e['value']);case'date':return new Date(_0x2cee1e['value']);case'error':return deserializeError(_0x2cee1e['value']);case'null':return null;case'undefined':return undefined;default:throw new Error('Invalid\x20se'+'rialized\x20o'+'bject\x20type');}}function deserialize(_0x28bcf3){if(typeof _0x28bcf3!=='string')throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x28bcf3+'.');const _0x43b7d7=doSerialize(_0x28bcf3);return deserializeReferences(_0x43b7d7,_0x43b7d7),_0x43b7d7;}module['exports']={'serialize':serialize,'deserialize':deserialize};
|
|
10
10
|
/* eslint-enable */
|