chore: add pkg dependencies
This commit is contained in:
51
node_modules/run-parallel/index.js
generated
vendored
Normal file
51
node_modules/run-parallel/index.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
module.exports = runParallel
|
||||
|
||||
const queueMicrotask = require('queue-microtask')
|
||||
|
||||
function runParallel (tasks, cb) {
|
||||
let results, pending, keys
|
||||
let isSync = true
|
||||
|
||||
if (Array.isArray(tasks)) {
|
||||
results = []
|
||||
pending = tasks.length
|
||||
} else {
|
||||
keys = Object.keys(tasks)
|
||||
results = {}
|
||||
pending = keys.length
|
||||
}
|
||||
|
||||
function done (err) {
|
||||
function end () {
|
||||
if (cb) cb(err, results)
|
||||
cb = null
|
||||
}
|
||||
if (isSync) queueMicrotask(end)
|
||||
else end()
|
||||
}
|
||||
|
||||
function each (i, err, result) {
|
||||
results[i] = result
|
||||
if (--pending === 0 || err) {
|
||||
done(err)
|
||||
}
|
||||
}
|
||||
|
||||
if (!pending) {
|
||||
// empty
|
||||
done(null)
|
||||
} else if (keys) {
|
||||
// object
|
||||
keys.forEach(function (key) {
|
||||
tasks[key](function (err, result) { each(key, err, result) })
|
||||
})
|
||||
} else {
|
||||
// array
|
||||
tasks.forEach(function (task, i) {
|
||||
task(function (err, result) { each(i, err, result) })
|
||||
})
|
||||
}
|
||||
|
||||
isSync = false
|
||||
}
|
58
node_modules/run-parallel/package.json
generated
vendored
Normal file
58
node_modules/run-parallel/package.json
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "run-parallel",
|
||||
"description": "Run an array of functions in parallel",
|
||||
"version": "1.2.0",
|
||||
"author": {
|
||||
"name": "Feross Aboukhadijeh",
|
||||
"email": "feross@feross.org",
|
||||
"url": "https://feross.org"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/feross/run-parallel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"queue-microtask": "^1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"airtap": "^3.0.0",
|
||||
"standard": "*",
|
||||
"tape": "^5.0.1"
|
||||
},
|
||||
"homepage": "https://github.com/feross/run-parallel",
|
||||
"keywords": [
|
||||
"parallel",
|
||||
"async",
|
||||
"function",
|
||||
"callback",
|
||||
"asynchronous",
|
||||
"run",
|
||||
"array",
|
||||
"run parallel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/feross/run-parallel.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && npm run test-node && npm run test-browser",
|
||||
"test-browser": "airtap -- test/*.js",
|
||||
"test-browser-local": "airtap --local -- test/*.js",
|
||||
"test-node": "tape test/*.js"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user