PHP 8.2.30
Preview: chain.js Size: 660 B
//lib/node_modules/npm/node_modules/slide/lib/chain.js

module.exports = chain
var bindActor = require("./bind-actor.js")
chain.first = {} ; chain.last = {}
function chain (things, cb) {
  var res = []
  ;(function LOOP (i, len) {
    if (i >= len) return cb(null,res)
    if (Array.isArray(things[i]))
      things[i] = bindActor.apply(null,
        things[i].map(function(i){
          return (i===chain.first) ? res[0]
           : (i===chain.last)
             ? res[res.length - 1] : i }))
    if (!things[i]) return LOOP(i + 1, len)
    things[i](function (er, data) {
      if (er) return cb(er, res)
      if (data !== undefined) res = res.concat(data)
      LOOP(i + 1, len)
    })
  })(0, things.length) }

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
1.69 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.44 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
382 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
660 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
121 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).