UNPKG

rbt_mssql-pool-party

Version:

Extension of mssql that provides management of multiple connection pools, dsns, retries, and more

12 lines (11 loc) 361 B
export default function wrapListeners(request, method) { const originalMethod = request[method]; return (event, handler) => { if (event.startsWith('_')) { originalMethod.call(request, event.substring(1), handler); } else { originalMethod.call(request, `poolparty_${event}`, handler); } return request; // chaining support }; }