UNPKG

aztec

Version:

Node Js Framework for creating API Services

14 lines (9 loc) 297 B
export const middleware = (req, res, array: any[]): void => { let functionIndex = 0; const next = (...args) => { functionIndex++; if (functionIndex === array.length) return null; array[functionIndex](...args, next); }; if (functionIndex === 0) array[0](req, res, next); };