Initial import with skill sheet working

This commit is contained in:
2024-12-04 00:11:23 +01:00
commit 9050c80ab4
4488 changed files with 671048 additions and 0 deletions

21
node_modules/bach/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014, 2016-2018, 2022 Blaine Bublitz <blaine.bublitz@gmail.com> and Eric Schoffstall <yo@contra.io>.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

261
node_modules/bach/README.md generated vendored Normal file
View File

@ -0,0 +1,261 @@
<p align="center">
<a href="https://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# bach
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Compose your async functions with elegance.
## Usage
With `bach`, it is very easy to compose async functions to run in series or parallel.
```js
var bach = require('bach');
function fn1(cb) {
cb(null, 1);
}
function fn2(cb) {
cb(null, 2);
}
function fn3(cb) {
cb(null, 3);
}
var seriesFn = bach.series(fn1, fn2, fn3);
// fn1, fn2, and fn3 will be run in series
seriesFn(function (err, res) {
if (err) {
// in this example, err is undefined
// handle error
}
// handle results
// in this example, res is [1, 2, 3]
});
var parallelFn = bach.parallel(fn1, fn2, fn3);
// fn1, fn2, and fn3 will be run in parallel
parallelFn(function (err, res) {
if (err) {
// in this example, err is undefined
// handle error
}
// handle results
// in this example, res is [1, 2, 3]
});
```
Since the composer functions return a function, you can combine them.
```js
var combinedFn = bach.series(fn1, bach.parallel(fn2, fn3));
// fn1 will be executed before fn2 and fn3 are run in parallel
combinedFn(function (err, res) {
if (err) {
// in this example, err is undefined
// handle error
}
// handle results
// in this example, res is [1, [2, 3]]
});
```
Functions are called with [async-done], so you can return a stream, promise, observable or child process. See [`async-done` completion and error resolution][completions] for more detail.
```js
// streams
var fs = require('fs');
function streamFn1() {
return fs
.createReadStream('./example')
.pipe(fs.createWriteStream('./example'));
}
function streamFn2() {
return fs
.createReadStream('./example')
.pipe(fs.createWriteStream('./example'));
}
var parallelStreams = bach.parallel(streamFn1, streamFn2);
parallelStreams(function (err) {
if (err) {
// in this example, err is undefined
// handle error
}
// all streams have emitted an 'end' or 'close' event
});
```
```js
// promises
function promiseFn1() {
return Promise.resolve(1);
}
function promiseFn2() {
return Promise.resolve(2);
}
var parallelPromises = bach.parallel(promiseFn1, promiseFn2);
parallelPromises(function (err, res) {
if (err) {
// in this example, err is undefined
// handle error
}
// handle results
// in this example, res is [1, 2]
});
```
All errors are caught in a [domain] and passed to the final callback as the first argument.
```js
function success(cb) {
setTimeout(function () {
cb(null, 1);
}, 500);
}
function error() {
throw new Error('Thrown Error');
}
var errorThrownFn = bach.parallel(error, success);
errorThrownFn(function (err, res) {
if (err) {
// handle error
// in this example, err is an error caught by the domain
}
// handle results
// in this example, res is [undefined]
});
```
When an error happens in a parallel composition, the callback will be called as soon as the error happens.
If you want to continue on error and wait until all functions have finished before calling the callback, use `settleSeries` or `settleParallel`.
```js
function success(cb) {
setTimeout(function () {
cb(null, 1);
}, 500);
}
function error(cb) {
cb(new Error('Async Error'));
}
var parallelSettlingFn = bach.settleParallel(success, error);
parallelSettlingFn(function (err, res) {
// all functions have finished executing
if (err) {
// handle error
// in this example, err is an error passed to the callback
}
// handle results
// in this example, res is [1]
});
```
## API
### `series(fns..., [options])`
Takes a variable amount of functions (`fns`) to be called in series when the returned function is
called. Optionally, takes an [options](#options) object as the last argument.
Returns an `invoker(cb)` function to be called to start the serial execution. The invoker function takes a callback (`cb`) with the `function(error, results)` signature.
If all functions complete successfully, the callback function will be called with all `results` as the second argument.
If an error occurs, execution will stop and the error will be passed to the callback function as the first parameter. The error parameter will always be a single error.
### `parallel(fns..., [options])`
Takes a variable amount of functions (`fns`) to be called in parallel when the returned function is
called. Optionally, takes an [options](#options) object as the last argument.
Returns an `invoker(cb)` function to be called to start the parallel execution. The invoker function takes a callback (`cb`) with the `function(error, results)` signature.
If all functions complete successfully, the callback function will be called with all `results` as the second argument.
If an error occurs, the callback function will be called with the error as the first parameter. Any async functions that have not completed, will still complete, but their results will **not** be available. The error parameter will always be a single error.
### `settleSeries(fns..., [options])`
Takes a variable amount of functions (`fns`) to be called in series when the returned function is
called. Optionally, takes an [options](#options) object as the last argument.
Returns an `invoker(cb)` function to be called to start the serial execution. The invoker function takes a callback (`cb`) with the `function(error, results)` signature.
All functions will always be called and the callback will receive all settled errors and results. If any errors occur, the error parameter will be an array of errors.
### `settleParallel(fns..., [options])`
Takes a variable amount of functions (`fns`) to be called in parallel when the returned function is
called. Optionally, takes an [options](#options) object as the last argument.
Returns an `invoker(cb)` function to be called to start the parallel execution. The invoker function takes a callback (`cb`) with the `function(error, results)` signature.
All functions will always be called and the callback will receive all settled errors and results. If any errors occur, the error parameter will be an array of errors.
### `options`
The `options` object is primarily used for specifying functions that give insight into the lifecycle of each function call. The possible extension points are `create`, `before`, `after` and `error`. If an extension point is not specified, it defaults to a no-op function.
The `options` object for `parallel` and `settleParallel` also allows specifying `concurrency` in which to run your functions. By default, your functions will run at maximum concurrency.
##### `options.concurrency`
Limits the amount of functions allowed to run at a given time.
##### `options.create(fn, index)`
Called at the very beginning of each function call with the function (`fn`) being executed and the `index` from the array/arguments. If `create` returns a value (`storage`), it is passed to the `before`, `after` and `error` extension points.
If a value is not returned, an empty object is used as `storage` for each other extension point.
This is useful for tracking information across an iteration.
##### `options.before(storage)`
Called immediately before each function call with the `storage` value returned from the `create` extension point.
##### `options.after(result, storage)`
Called immediately after each function call with the `result` of the function and the `storage` value returned from the `create` extension point.
##### `options.error(error, storage)`
Called immediately after a failed function call with the `error` of the function and the `storage` value returned from the `create` extension point.
## License
MIT
<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/bach.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/bach
[npm-image]: https://img.shields.io/npm/v/bach.svg?style=flat-square
[ci-url]: https://github.com/gulpjs/bach/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/bach/dev?style=flat-square
[coveralls-url]: https://coveralls.io/r/gulpjs/bach
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/bach.svg?style=flat-square
<!-- prettier-ignore-end -->
<!-- prettier-ignore-start -->
[domain]: https://nodejs.org/api/domain.html
[async-done]: https://github.com/gulpjs/async-done
[completions]: https://github.com/gulpjs/async-done#completion-and-error-resolution
<!-- prettier-ignore-end -->

8
node_modules/bach/index.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
'use strict';
module.exports = {
series: require('./lib/series'),
parallel: require('./lib/parallel'),
settleSeries: require('./lib/settleSeries'),
settleParallel: require('./lib/settleParallel'),
};

94
node_modules/bach/lib/helpers.js generated vendored Normal file
View File

@ -0,0 +1,94 @@
'use strict';
function noop() {}
function getOptions(args) {
// TODO: use `.at(-1)` when the API is available
var lastArg = args.slice(-1)[0];
if (typeof lastArg !== 'function') {
return lastArg;
}
}
function filterSuccess(elem) {
return elem.state === 'success';
}
function filterError(elem) {
return elem.state === 'error';
}
function pluckValue(elem) {
return elem.value;
}
function buildOnSettled(done) {
if (typeof done !== 'function') {
done = noop;
}
function onSettled(error, result) {
if (error) {
return done(error, null);
}
if (!Array.isArray(result)) {
result = [];
}
var settledErrors = result.filter(filterError);
var settledResults = result.filter(filterSuccess);
var errors = null;
if (settledErrors.length) {
errors = settledErrors.map(pluckValue);
}
var results = null;
if (settledResults.length) {
results = settledResults.map(pluckValue);
}
done(errors, results);
}
return onSettled;
}
function verifyArguments(args) {
args = Array.prototype.concat.apply([], args);
if (!args.length) {
throw new Error('A set of functions to combine is required');
}
args.forEach(verifyEachArg);
return args;
}
function verifyEachArg(arg, argIdx, args) {
var isFunction = typeof arg === 'function';
if (isFunction) {
return;
}
if (argIdx === args.length - 1) {
// Last arg can be an object of extension points
return;
}
var msg =
'Only functions can be combined, got ' +
typeof arg +
' for argument ' +
argIdx;
throw new Error(msg);
}
module.exports = {
getOptions: getOptions,
onSettled: buildOnSettled,
verifyArguments: verifyArguments,
};

28
node_modules/bach/lib/parallel.js generated vendored Normal file
View File

@ -0,0 +1,28 @@
'use strict';
var asyncDone = require('async-done');
var nowAndLater = require('now-and-later');
var helpers = require('./helpers');
function iterator(fn, key, cb) {
return asyncDone(fn, cb);
}
function buildParallel() {
var args = helpers.verifyArguments(arguments);
var options = helpers.getOptions(args);
if (options) {
args = args.slice(0, -1);
}
function parallel(done) {
nowAndLater.map(args, iterator, options, done);
}
return parallel;
}
module.exports = buildParallel;

28
node_modules/bach/lib/series.js generated vendored Normal file
View File

@ -0,0 +1,28 @@
'use strict';
var asyncDone = require('async-done');
var nowAndLater = require('now-and-later');
var helpers = require('./helpers');
function iterator(fn, key, cb) {
return asyncDone(fn, cb);
}
function buildSeries() {
var args = helpers.verifyArguments(arguments);
var options = helpers.getOptions(args);
if (options) {
args = args.slice(0, -1);
}
function series(done) {
nowAndLater.mapSeries(args, iterator, options, done);
}
return series;
}
module.exports = buildSeries;

29
node_modules/bach/lib/settleParallel.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
'use strict';
var asyncSettle = require('async-settle');
var nowAndLater = require('now-and-later');
var helpers = require('./helpers');
function iterator(fn, key, cb) {
return asyncSettle(fn, cb);
}
function buildSettleParallel() {
var args = helpers.verifyArguments(arguments);
var options = helpers.getOptions(args);
if (options) {
args = args.slice(0, -1);
}
function settleParallel(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.map(args, iterator, options, onSettled);
}
return settleParallel;
}
module.exports = buildSettleParallel;

29
node_modules/bach/lib/settleSeries.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
'use strict';
var asyncSettle = require('async-settle');
var nowAndLater = require('now-and-later');
var helpers = require('./helpers');
function iterator(fn, key, cb) {
return asyncSettle(fn, cb);
}
function buildSettleSeries() {
var args = helpers.verifyArguments(arguments);
var options = helpers.getOptions(args);
if (options) {
args = args.slice(0, -1);
}
function settleSeries(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.mapSeries(args, iterator, options, onSettled);
}
return settleSeries;
}
module.exports = buildSettleSeries;

76
node_modules/bach/package.json generated vendored Normal file
View File

@ -0,0 +1,76 @@
{
"name": "bach",
"version": "2.0.1",
"description": "Compose your async functions with elegance.",
"author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>",
"Pawel Kozlowski <pkozlowski.opensource@gmail.com>",
"Benjamin Tan <demoneaux@gmail.com>"
],
"repository": "gulpjs/bach",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
},
"main": "index.js",
"files": [
"index.js",
"lib",
"LICENSE"
],
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc mocha --async-only"
},
"dependencies": {
"async-done": "^2.0.0",
"async-settle": "^2.0.0",
"now-and-later": "^3.0.0"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-gulp": "^5.0.1",
"expect": "^27.5.1",
"mocha": "^8.4.0",
"nyc": "^15.1.0"
},
"nyc": {
"reporter": [
"lcov",
"text-summary"
]
},
"prettier": {
"singleQuote": true
},
"keywords": [
"compose",
"fluent",
"composing",
"continuation",
"function composition",
"functional",
"async",
"map",
"series",
"parallel",
"extension",
"tracing",
"debug",
"timing",
"aop",
"settle",
"promises",
"callbacks",
"observables",
"streams",
"end",
"completion",
"complete",
"finish",
"done",
"error handling"
]
}