@brown-ds/distribution 0.1.13 → 0.1.15
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 log=require('../util/lo'+'g'),routesStore=new Map();function get(
|
|
9
|
+
const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x3313fa,_0x95e876){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x3313fa));if(!_0x95e876)return;typeof _0x3313fa==='string'&&(_0x3313fa={'service':_0x3313fa});const _0x260761=_0x3313fa['service'],_0x54d5f3=_0x3313fa['gid'];if(_0x54d5f3&&_0x54d5f3!=='local')log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x260761),_0x95e876(null,global['distributi'+'on'][_0x54d5f3][_0x260761]);else{if(_0x260761 in routesStore)log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x260761),_0x95e876(null,routesStore[_0x260761]);else{const _0x57d4b5=global['toLocal'][_0x260761];_0x57d4b5?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x260761),_0x95e876(null,{'call':_0x57d4b5})):_0x95e876(new Error('Service\x20'+_0x260761+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x2dd48b,_0x506066,_0xabfbb8){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x506066+'\x20'+JSON['stringify'](_0x2dd48b)),routesStore[_0x506066]=_0x2dd48b;_0xabfbb8&&_0xabfbb8(null,_0x506066);;}function rem(_0x1866c7,_0xee2305){const _0x348046=routesStore[_0x1866c7];delete routesStore[_0x1866c7],_0xee2305(null,_0x348046);};module['exports']={'get':get,'put':put,'rem':rem};
|
|
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 log=require('../util/lo'+'g');global['toLocal']=
|
|
9
|
+
const log=require('../util/lo'+'g');global['toLocal']={};function createRPC(_0x53d9ce){const _0x1bbb93=global['distributi'+'on']['util']['id']['getID'](global['distributi'+'on']['util']['serialize'](_0x53d9ce));global['toLocal'][_0x1bbb93]=_0x53d9ce;let _0x242308='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](global['nodeConfig'])+(',\x20service:'+'\x20\x27')+_0x1bbb93+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0x1bbb93);const _0x221b19=Array['from']({'length':_0x53d9ce['length']},(_0x4719ea,_0x211b45)=>'arg'+_0x211b45)['join'](',\x20');return new Function(_0x221b19,_0x242308);}function toAsync(_0x3e70b9){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x3e70b9['name']+':\x20'+_0x3e70b9['toString']()['replace'](/\n/g,'|'));const _0x1fb855=(..._0x1b9e90)=>{const _0x35452d=_0x1b9e90['pop']();try{const _0x1ceb7e=_0x3e70b9(..._0x1b9e90);_0x35452d(null,_0x1ceb7e);}catch(_0x4eece5){_0x35452d(_0x4eece5);}};return _0x1fb855['toString']=()=>_0x3e70b9['toString'](),_0x1fb855;}module['exports']={'createRPC':createRPC,'toAsync':toAsync};
|
|
10
10
|
/* eslint-enable */
|