UNPKG

light-ning

Version:

(ALPHA) framework without dependecies...

14 lines (9 loc) 273 B
export default (req, res, array) => { 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); };