slavery-js
Version:
A simple clustering app that allows you to scale an application on multiple thread, containers or machines
1 lines • 923 B
Source Map (JSON)
{"version":3,"sources":["../../src/utils/toListeners.ts"],"sourcesContent":["import { SlaveMethods } from '../service/index.js'\nimport { Listener } from '../network/index.js'\n\n/* this function will take a type slaveMethods passed to a Service and return a type Listener */\nfunction toListeners(slaveMethods: SlaveMethods): Listener[] {\n return Object.keys(slaveMethods).map((key) => ({\n event: key,\n parameters: slaveMethods[key].length > 0 ? new Array(slaveMethods[key].length).fill(undefined) : undefined,\n callback: slaveMethods[key],\n }));\n\n}\n\nexport default toListeners\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAS,YAAY,cAAwC;AACzD,SAAO,OAAO,KAAK,YAAY,EAAE,IAAI,CAAC,SAAS;AAAA,IAC3C,OAAO;AAAA,IACP,YAAY,aAAa,GAAG,EAAE,SAAS,IAAI,IAAI,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,KAAK,MAAS,IAAI;AAAA,IACjG,UAAU,aAAa,GAAG;AAAA,EAC9B,EAAE;AAEN;AAEA,IAAO,sBAAQ;","names":[]}