@brown-ds/distribution 0.2.28 → 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.
package/README.md CHANGED
@@ -99,15 +99,25 @@ If you wanted to run this same sequence of commands in a script, you could do so
99
99
  ```js
100
100
  let distribution = require("@brown-ds/distribution")();
101
101
  // Now we're only doing a few of the things we did above
102
+ const out = (cb) => {
103
+ distribution.local.status.stop(cb); // Shut down the local node
104
+ };
102
105
  distribution.node.start(() => {
103
106
  // This will run only after the node has started
104
- node = { ip: '127.0.0.1', port: 8080 };
105
- distribution.local.status.spawn(node, () => {
107
+ const node = {ip: '127.0.0.1', port: 8765};
108
+ distribution.local.status.spawn(node, (e, v) => {
109
+ if (e) {
110
+ return out(console.log);
111
+ }
106
112
  // This will run only after the new node has been spawned
107
113
  distribution.all.status.get('sid', (e, v) => {
108
- // This will run only after we communicated with all nodes and got their sids
109
- console.log(v); // { '8cf1b': '8cf1b', '8cf1c': '8cf1c' }
110
- distribution.local.status.stop(console.log);
114
+ // This will run only after we communicated with all nodes and got their sids
115
+ console.log(v); // { '8cf1b': '8cf1b', '8cf1c': '8cf1c' }
116
+ // Shut down the remote node
117
+ distribution.local.comm.send([], {service: 'status', method: 'stop', node: node}, () => {
118
+ // Finally, stop the local node
119
+ out(console.log); // null, {ip: '127.0.0.1', port: 1380}
120
+ });
111
121
  });
112
122
  });
113
123
  });
@@ -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
- function comm(_0x2019ba){const _0x285313={};_0x285313['gid']=_0x2019ba['gid']||'all';function _0x577a6a(_0x2056fd,_0x124d3c,_0x1f2069){globalThis['distributi'+'on']['local']['groups']['get'](_0x285313['gid'],(_0x2d1099,_0x592d32)=>{if(!_0x592d32){_0x1f2069(_0x2d1099);return;}const _0x208bd1=Object['keys'](_0x592d32)['length'];if(_0x208bd1===0x1f82+-0x5d*0x6+-0x1d54){_0x1f2069(new Error('No\x20nodes\x20i'+'n\x20group\x20'+_0x285313['gid']+'\x20found!'));return;}let _0x502634=0x1*-0x210e+0xaf2+-0x587*-0x4;const _0x34ae1c={},_0x4e14df={};for(const _0x5d24fd of Object['keys'](_0x592d32)){const _0x3ca66f=_0x592d32[_0x5d24fd],_0x21dcd4={'node':{'ip':_0x3ca66f['ip'],'port':_0x3ca66f['port']},'service':_0x124d3c['service'],'method':_0x124d3c['method'],'gid':_0x124d3c['gid']||'local'};globalThis['distributi'+'on']['local']['comm']['send'](_0x2056fd,_0x21dcd4,(_0x504bd9,_0x213b4a)=>{_0x504bd9?_0x4e14df[_0x5d24fd]=_0x504bd9:_0x34ae1c[_0x5d24fd]=_0x213b4a;_0x502634+=-0xb*0x2+0x31c+-0x305;if(_0x502634===_0x208bd1)return _0x1f2069(_0x4e14df,_0x34ae1c);});}});}return{'send':_0x577a6a};}module['exports']=comm;
9
+ function comm(_0x17e568){const _0x543f7b={};_0x543f7b['gid']=_0x17e568['gid']||'all';function _0x4738df(_0x114e26,_0x27d271,_0x43252b){globalThis['distributi'+'on']['local']['groups']['get'](_0x543f7b['gid'],(_0x5d70cd,_0x40759f)=>{if(!_0x40759f){_0x43252b(_0x5d70cd);return;}const _0x369edf=Object['keys'](_0x40759f)['length'];if(_0x369edf===-0x2*0x3f5+-0x2*0x9f1+0x1bcc){_0x43252b(new Error('No\x20nodes\x20i'+'n\x20group\x20'+_0x543f7b['gid']+'\x20found!'));return;}let _0x1b730e=0x1072+0xfdd+-0x204f;const _0x5ae99f={},_0x2af7b0={};for(const _0x33c7ce of Object['keys'](_0x40759f)){const _0x959419=_0x40759f[_0x33c7ce],_0x574b2d={'node':{'ip':_0x959419['ip'],'port':_0x959419['port']},'service':_0x27d271['service'],'method':_0x27d271['method'],'gid':_0x27d271['gid']||'local'};globalThis['distributi'+'on']['local']['comm']['send'](_0x114e26,_0x574b2d,(_0x4aadb3,_0x3ecdc4)=>{_0x4aadb3?_0x2af7b0[_0x33c7ce]=_0x4aadb3:_0x5ae99f[_0x33c7ce]=_0x3ecdc4;_0x1b730e+=0x6da+0x1*0x17ee+-0x1ec7;if(_0x1b730e===_0x369edf)return _0x43252b(_0x2af7b0,_0x5ae99f);});}});return;_0x43252b(new Error('comm.send\x20'+'not\x20implem'+'ented'));}return{'send':_0x4738df};}module['exports']=comm;
10
10
  /* eslint-enable */
@@ -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
- function status(_0xe569d2){const _0x2b7dcc={};_0x2b7dcc['gid']=_0xe569d2['gid']||'all';function _0x502cb(_0x1e3422,_0x5d23ae){const _0x5c5355=[_0x1e3422],_0x2b2161={'service':'status','method':'get'};globalThis['distributi'+'on'][_0x2b7dcc['gid']]['comm']['send'](_0x5c5355,_0x2b2161,(_0x466833,_0xe860e9)=>{switch(_0x1e3422){case'heapTotal':const _0x2b6d9a=Object['values'](_0xe860e9)['reduce']((_0x22e7fd,_0x129ddc)=>{return _0x22e7fd+_0x129ddc;},-0x122d+-0x1*0x235d+0x358a);return _0x5d23ae(_0x466833,_0x2b6d9a);break;case'nid':const _0x3bc516=Object['values'](_0xe860e9)['reduce']((_0x41c188,_0x302416)=>{return _0x41c188['concat'](_0x302416);},[]);return _0x5d23ae(_0x466833,_0x3bc516);break;default:return _0x5d23ae(_0x466833,_0xe860e9);break;}});}function _0x5076fe(_0x6ee9a0,_0xc6f21d){globalThis['distributi'+'on']['local']['status']['spawn'](_0x6ee9a0,(_0x2fadf6,_0x459797)=>{globalThis['distributi'+'on'][_0x2b7dcc['gid']]['comm']['send']([_0x2b7dcc['gid'],_0x6ee9a0],{'service':'groups','method':'add'},()=>{});if(_0x2fadf6)return _0xc6f21d(_0x2fadf6);globalThis['distributi'+'on']['local']['groups']['add'](_0x2b7dcc['gid'],_0x6ee9a0,()=>{return _0xc6f21d(null,_0x459797);});});return;_0xc6f21d(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function _0x5cfcfa(_0x5397c5){globalThis['distributi'+'on'][_0x2b7dcc['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{globalThis['distributi'+'on']['local']['status']['stop'](_0x5397c5);});return;_0x5397c5(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}return{'get':_0x502cb,'stop':_0x5cfcfa,'spawn':_0x5076fe};}module['exports']=status;
9
+ function status(_0x423aac){const _0x41f0a4={};_0x41f0a4['gid']=_0x423aac['gid']||'all';function _0x28bb8a(_0x5996f0,_0x40a397){const _0x45ffcc=[_0x5996f0],_0x321e52={'service':'status','method':'get'};globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send'](_0x45ffcc,_0x321e52,(_0x3ac603,_0x3c8658)=>{switch(_0x5996f0){case'heapTotal':const _0x16d43a=Object['values'](_0x3c8658)['reduce']((_0x36a757,_0x4c9396)=>{return _0x36a757+_0x4c9396;},-0x7f*0x4a+0x19*0x1d+-0x15*-0x19d);return _0x40a397(_0x3ac603,_0x16d43a);break;case'nid':const _0x34ffda=Object['values'](_0x3c8658)['reduce']((_0x27a954,_0x186898)=>{return _0x27a954['concat'](_0x186898);},[]);return _0x40a397(_0x3ac603,_0x34ffda);break;default:return _0x40a397(_0x3ac603,_0x3c8658);break;}});return;_0x40a397(new Error('status.get'+'\x20not\x20imple'+'mented'));}function _0x38df6f(_0x1b0684,_0x2f73ba){globalThis['distributi'+'on']['local']['status']['spawn'](_0x1b0684,(_0x484b26,_0x1ab6fd)=>{globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send']([_0x41f0a4['gid'],_0x1b0684],{'service':'groups','method':'add'},()=>{});if(_0x484b26)return _0x2f73ba(_0x484b26);globalThis['distributi'+'on']['local']['groups']['add'](_0x41f0a4['gid'],_0x1b0684,()=>{return _0x2f73ba(null,_0x1ab6fd);});});return;_0x2f73ba(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function _0x547b3a(_0x4b6742){globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{globalThis['distributi'+'on']['local']['status']['stop'](_0x4b6742);});return;_0x4b6742(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}return{'get':_0x28bb8a,'stop':_0x547b3a,'spawn':_0x38df6f};}module['exports']=status;
10
10
  /* eslint-enable */
@@ -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 _0x404350=[];function _0x3f00f3(_0x5ac571,_0x269c43){if(_0x269c43===null||_0x269c43===undefined)return;if(_0x404350['indexOf'](_0x269c43)!==-(-0x10e7+0x172e+0x1*-0x646))return;_0x404350['push'](_0x269c43),Object['getOwnProp'+'ertyNames'](_0x269c43)['forEach'](_0x4e2d8a=>{if(typeof _0x269c43[_0x4e2d8a]==='function'){nativeFunctions['forward']['set'](_0x269c43[_0x4e2d8a],_0x5ac571+'.'+_0x4e2d8a),nativeFunctions['reverse']['set'](_0x5ac571+'.'+_0x4e2d8a,_0x269c43[_0x4e2d8a]);return;}typeof _0x269c43[_0x4e2d8a]==='object'&&_0x404350['indexOf'](_0x269c43[_0x4e2d8a])===-(0x3b7*-0x1+-0x115*0x6+0xa36)&&_0x3f00f3(_0x5ac571+'.'+_0x4e2d8a,_0x269c43[_0x4e2d8a]);});}for(const _0xcd95ea of require('repl')['_builtinLi'+'bs']){if(['wasi','sys','punycode','crypto']['includes'](_0xcd95ea))continue;const _0x5739bc=require(_0xcd95ea);_0x3f00f3(_0xcd95ea,_0x5739bc);}}createNativeMap();function decycleObject(_0x34e228){if(_0x34e228===null||_0x34e228===undefined)return _0x34e228;const _0x540b4e=new WeakMap();function _0x38a577(_0x78cf26,_0x1b0f00){let _0xcc04b0;if(!(typeof _0x78cf26==='object'&&!(_0x78cf26 instanceof Error)&&!(_0x78cf26 instanceof Date)&&!(_0x78cf26 instanceof Boolean)&&_0x78cf26!==null))return _0x78cf26;const _0xf3d91e=_0x540b4e['get'](_0x78cf26);if(_0xf3d91e!==undefined)return{'$reference':_0xf3d91e};return _0x540b4e['set'](_0x78cf26,_0x1b0f00),Array['isArray'](_0x78cf26)?(_0xcc04b0=[],_0x78cf26['forEach'](function(_0x32bd04,_0x8a6618){const _0x1c3add=[..._0x1b0f00,_0x8a6618];_0xcc04b0[_0x8a6618]=_0x38a577(_0x32bd04,_0x1c3add);})):(_0xcc04b0={},Object['keys'](_0x78cf26)['forEach'](_0x177fb4=>{const _0x51fc50=[..._0x1b0f00,JSON['stringify'](_0x177fb4)];_0xcc04b0[_0x177fb4]=_0x38a577(_0x78cf26[_0x177fb4],_0x51fc50);})),_0xcc04b0;}return _0x38a577(_0x34e228,[]);}function serializeBaseStructure(_0x10f456){return{'type':typeof _0x10f456,'value':_0x10f456['toString']()};}function serializeBigInt(_0xbdc724){return{'type':'bigint','value':_0xbdc724['toString']()};}function serializeUndefined(_0xb3c155){return{'type':'undefined','value':''};}function serializeObject(_0x1db01e){if(_0x1db01e===null)return{'type':'null','value':''};else{if(_0x1db01e instanceof Date)return{'type':'date','value':_0x1db01e['toJSON']()};else{if(_0x1db01e instanceof Error)return{'type':'error','value':serializeObject({'name':_0x1db01e['name'],'message':_0x1db01e['message'],'cause':_0x1db01e['cause']})};}}if(_0x1db01e['$reference']!==undefined&&Object['keys'](_0x1db01e)['length']===-0x14*-0x17+0xa*-0x1a5+-0xb*-0x155)return{'type':'reference','value':_0x1db01e['$reference']};const _0x20c2d2=Object['fromEntrie'+'s'](Object['entries'](_0x1db01e)['map'](([_0x59c0aa,_0xfb4a8e])=>[_0x59c0aa,serialize(_0xfb4a8e)]));return{'type':_0x1db01e instanceof Array?'array':'object','value':_0x20c2d2};}function serializeFunction(_0x38e653){const _0x38fb7a=nativeFunctions['forward']['get'](_0x38e653);return _0x38fb7a===undefined?{'type':'function','value':_0x38e653['toString']()}:{'type':'native','value':_0x38fb7a};}function serialize(_0x4d944c){_0x4d944c=decycleObject(_0x4d944c);let _0x449851;switch(typeof _0x4d944c){case'object':_0x449851=serializeObject(_0x4d944c);break;case'function':_0x449851=serializeFunction(_0x4d944c);break;case'undefined':_0x449851=serializeUndefined(_0x4d944c);break;case'number':case'string':case'boolean':_0x449851=serializeBaseStructure(_0x4d944c);break;case'bigint':_0x449851=serializeBigInt(_0x4d944c);break;}return JSON['stringify'](_0x449851);}function deserializeObject(_0xb07ca,_0x1d43e4){for(const [_0xa696f6,_0x4f0f65]of Object['entries'](_0xb07ca)){_0x1d43e4[_0xa696f6]=doSerialize(_0x4f0f65,_0x1d43e4);}return _0x1d43e4;}function deserializeArray(_0x46048f,_0x47c969){for(const [_0x15070e,_0x5ba4a3]of Object['entries'](_0x46048f)){_0x47c969[Number(_0x15070e)]=doSerialize(_0x5ba4a3,_0x47c969);}return _0x47c969;}function deserializeString(_0x37b705){return _0x37b705;}function deserializeNumber(_0x471aa0){return Number(_0x471aa0);}function deserializeFunction(_0x612ed7){return new Function('return\x20'+_0x612ed7)();}function deserializeError(_0x2e3adb){const _0x4f1b6c=doSerialize(_0x2e3adb),_0x5f4632=new Error(_0x4f1b6c['message'],_0x4f1b6c['cause']);return _0x5f4632;}function deserializeReference(_0x287fe9,_0x17258d){let _0x38b8a5=_0x17258d;for(const _0x22de58 of _0x287fe9){_0x38b8a5=_0x38b8a5[JSON['parse'](_0x22de58)];}return _0x38b8a5;}function deserializeNative(_0x11d654){const _0x56229e=nativeFunctions['reverse']['get'](_0x11d654);if(_0x56229e===undefined)throw Error('Function\x20n'+'ot\x20found\x20i'+'n\x20native\x20f'+'unction\x20ma'+'p');return _0x56229e;}function deserializeReferences(_0x39daf1,_0x1d28d2){if(typeof _0x39daf1!=='object'||_0x39daf1===null)return _0x39daf1;if(_0x39daf1['type']==='reference')return deserializeReference(_0x39daf1['value'],_0x1d28d2);if(Array['isArray'](_0x39daf1))for(let _0x47cbb4=-0x1ed6+0x3e7+0x563*0x5;_0x47cbb4<_0x39daf1['length'];_0x47cbb4++){_0x39daf1[_0x47cbb4]=deserializeReferences(_0x39daf1[_0x47cbb4],_0x1d28d2);}else for(const [_0xbd32ca,_0x4eef23]of Object['entries'](_0x39daf1)){_0x39daf1[_0xbd32ca]=deserializeReferences(_0x4eef23,_0x1d28d2);}return _0x39daf1;}function doSerialize(_0x3b5585,_0x588a31=null){let _0x5d5928;if(typeof _0x3b5585==='object')_0x5d5928=_0x3b5585;else{if(typeof _0x3b5585==='string')_0x5d5928=JSON['parse'](_0x3b5585);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x3b5585+'.');}_0x588a31===null&&(_0x588a31={});switch(_0x5d5928['type']){case'object':return deserializeObject(_0x5d5928['value'],{});case'array':return deserializeArray(_0x5d5928['value'],[]);case'function':return deserializeFunction(_0x5d5928['value']);case'native':return deserializeNative(_0x5d5928['value']);case'reference':return _0x5d5928;case'number':return deserializeNumber(_0x5d5928['value']);case'string':return deserializeString(_0x5d5928['value']);case'boolean':return _0x5d5928['value']==='true';case'bigint':return BigInt(_0x5d5928['value']);case'date':return new Date(_0x5d5928['value']);case'error':return deserializeError(_0x5d5928['value']);case'null':return null;case'undefined':return undefined;default:throw new Error('Invalid\x20se'+'rialized\x20o'+'bject\x20type');}}function deserialize(_0x1b2d00){if(typeof _0x1b2d00!=='string')throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x1b2d00+'.');const _0x17e244=doSerialize(_0x1b2d00);return deserializeReferences(_0x17e244,_0x17e244),_0x17e244;}module['exports']={'serialize':serialize,'deserialize':deserialize};
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 */
package/distribution.js CHANGED
@@ -21,17 +21,17 @@ function bootstrap(config) {
21
21
  }
22
22
  // __end_solution__
23
23
  const distribution = {};
24
+
24
25
  // @ts-ignore This is the first time globalThis.distribution is being initialized, so the object does not have all the necessary properties.
25
26
  globalThis.distribution = distribution;
26
27
  distribution.util = require('./distribution/util/util.js');
27
28
 
28
29
  // @ts-ignore node.server is lazily initialized.
29
30
  distribution.node = require('./distribution/local/node.js');
30
- distribution.local = require('./distribution/local/local.js');
31
-
32
31
  if (config) {
33
32
  distribution.node.config = config;
34
33
  }
34
+ distribution.local = require('./distribution/local/local.js');
35
35
 
36
36
  const {setup} = require('./distribution/all/all.js');
37
37
  distribution.all = setup({gid: 'all'});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,