%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/node_modules/pm2/node_modules/run-series/
Upload File :
Create Path :
Current File : //lib/node_modules/pm2/node_modules/run-series/index.js

/*! run-series. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
module.exports = runSeries

function runSeries (tasks, cb) {
  var current = 0
  var results = []
  var isSync = true

  function done (err) {
    function end () {
      if (cb) cb(err, results)
    }
    if (isSync) process.nextTick(end)
    else end()
  }

  function each (err, result) {
    results.push(result)
    if (++current >= tasks.length || err) done(err)
    else tasks[current](each)
  }

  if (tasks.length > 0) tasks[0](each)
  else done(null)

  isSync = false
}

Zerion Mini Shell 1.0