index.js
function promesso (handler) {
  const handleFn = isFunction(handler) ? [handler] : handler;
  const middlewares = [];
  let validations = 0;

  handleFn.forEach(h => {
    if (!isFunction(h)) throw new Error('Handler is expected to be a function or an Array of functions.');

    if (isObject(handleFn['@validation'])) {
      middlewares.push(validation(h['@validation']), validationMiddleware);
      if (++validations > 1) throw new Error('Every handler can have only one validator per chain.');
    }

    middlewares.push(h);
  });

  return middlewares.map(rawOrPromise);
}
function promesso (handler) {
  const handleFn = isFunction(handler) ? [handler] : handler;
  const middlewares = [];
  let validations = 0;

  handleFn.forEach(h => {
    if (!isFunction(h)) throw new Error('Handler is expected to be a function or an Array of functions.');

    if (isObject(handleFn['@validation'])) {
      middlewares.push(validation(h['@validation']), validationMiddleware);
      if (++validations > 1) throw new Error('Every handler can have only one validator per chain.');
    }

    middlewares.push(h);
  });

  return middlewares.map(rawOrPromise);
}
function promesso ( handler ) { const handleFn = isFunction ( handler ) ? [ handler ] : handler ; const middlewares = [ ] ; let validations = 0 ; handleFn . forEach ( h => { if ( ! isFunction ( h ) ) throw new Error ( 'Handler is expected to be a function or an Array of functions.' ) ; if ( isObject ( handleFn [ '@validation' ] ) ) { middlewares . push ( validation ( h [ '@validation' ] ) , validationMiddleware ) ; if ( ++ validations > 1 ) throw new Error ( 'Every handler can have only one validator per chain.' ) ; } middlewares . push ( h ) ; } ) ; return middlewares . map ( rawOrPromise ) ; }
promesso takes a Promise-based middleware function and converts it to a classic array of middlewares

@param  {Function|Function[]} handler: Promise-based Express middleware
@return {Function[]} Express-compliant Array of middlewares
promesso takes a Promise - based middleware function and converts it to a classic array of middlewares