@nocobase/plugin-backup-restore 1.7.0-beta.9 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/c92981952ddacb98.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/dist/node_modules/@hapi/topo/package.json +1 -1
- package/dist/node_modules/archiver/index.js +2 -2
- package/dist/node_modules/archiver/node_modules/async/all.js +119 -0
- package/dist/node_modules/archiver/node_modules/async/allLimit.js +46 -0
- package/dist/node_modules/archiver/node_modules/async/allSeries.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/any.js +122 -0
- package/dist/node_modules/archiver/node_modules/async/anyLimit.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/anySeries.js +46 -0
- package/dist/node_modules/archiver/node_modules/async/apply.js +11 -0
- package/dist/node_modules/archiver/node_modules/async/applyEach.js +57 -0
- package/dist/node_modules/archiver/node_modules/async/applyEachSeries.js +37 -0
- package/dist/node_modules/archiver/node_modules/async/asyncify.js +118 -0
- package/dist/node_modules/archiver/node_modules/async/auto.js +333 -0
- package/dist/node_modules/archiver/node_modules/async/autoInject.js +182 -0
- package/dist/node_modules/archiver/node_modules/async/bower.json +17 -0
- package/dist/node_modules/archiver/node_modules/async/cargo.js +63 -0
- package/dist/node_modules/archiver/node_modules/async/cargoQueue.js +71 -0
- package/dist/node_modules/archiver/node_modules/async/compose.js +55 -0
- package/dist/node_modules/archiver/node_modules/async/concat.js +115 -0
- package/dist/node_modules/archiver/node_modules/async/concatLimit.js +60 -0
- package/dist/node_modules/archiver/node_modules/async/concatSeries.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/constant.js +14 -0
- package/dist/node_modules/archiver/node_modules/async/detect.js +96 -0
- package/dist/node_modules/archiver/node_modules/async/detectLimit.js +48 -0
- package/dist/node_modules/archiver/node_modules/async/detectSeries.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/dir.js +43 -0
- package/dist/node_modules/archiver/node_modules/async/dist/async.js +6062 -0
- package/dist/node_modules/archiver/node_modules/async/dist/async.min.js +1 -0
- package/dist/node_modules/archiver/node_modules/async/doDuring.js +68 -0
- package/dist/node_modules/archiver/node_modules/async/doUntil.js +46 -0
- package/dist/node_modules/archiver/node_modules/async/doWhilst.js +68 -0
- package/dist/node_modules/archiver/node_modules/async/during.js +78 -0
- package/dist/node_modules/archiver/node_modules/async/each.js +129 -0
- package/dist/node_modules/archiver/node_modules/async/eachLimit.js +50 -0
- package/dist/node_modules/archiver/node_modules/async/eachOf.js +185 -0
- package/dist/node_modules/archiver/node_modules/async/eachOfLimit.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/eachOfSeries.js +39 -0
- package/dist/node_modules/archiver/node_modules/async/eachSeries.js +44 -0
- package/dist/node_modules/archiver/node_modules/async/ensureAsync.js +67 -0
- package/dist/node_modules/archiver/node_modules/async/every.js +119 -0
- package/dist/node_modules/archiver/node_modules/async/everyLimit.js +46 -0
- package/dist/node_modules/archiver/node_modules/async/everySeries.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/filter.js +93 -0
- package/dist/node_modules/archiver/node_modules/async/filterLimit.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/filterSeries.js +43 -0
- package/dist/node_modules/archiver/node_modules/async/find.js +96 -0
- package/dist/node_modules/archiver/node_modules/async/findLimit.js +48 -0
- package/dist/node_modules/archiver/node_modules/async/findSeries.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/flatMap.js +115 -0
- package/dist/node_modules/archiver/node_modules/async/flatMapLimit.js +60 -0
- package/dist/node_modules/archiver/node_modules/async/flatMapSeries.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/foldl.js +153 -0
- package/dist/node_modules/archiver/node_modules/async/foldr.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/forEach.js +129 -0
- package/dist/node_modules/archiver/node_modules/async/forEachLimit.js +50 -0
- package/dist/node_modules/archiver/node_modules/async/forEachOf.js +185 -0
- package/dist/node_modules/archiver/node_modules/async/forEachOfLimit.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/forEachOfSeries.js +39 -0
- package/dist/node_modules/archiver/node_modules/async/forEachSeries.js +44 -0
- package/dist/node_modules/archiver/node_modules/async/forever.js +68 -0
- package/dist/node_modules/archiver/node_modules/async/groupBy.js +108 -0
- package/dist/node_modules/archiver/node_modules/async/groupByLimit.js +71 -0
- package/dist/node_modules/archiver/node_modules/async/groupBySeries.js +36 -0
- package/dist/node_modules/archiver/node_modules/async/index.js +588 -0
- package/dist/node_modules/archiver/node_modules/async/inject.js +153 -0
- package/dist/node_modules/archiver/node_modules/async/internal/DoublyLinkedList.js +92 -0
- package/dist/node_modules/archiver/node_modules/async/internal/Heap.js +120 -0
- package/dist/node_modules/archiver/node_modules/async/internal/applyEach.js +29 -0
- package/dist/node_modules/archiver/node_modules/async/internal/asyncEachOfLimit.js +75 -0
- package/dist/node_modules/archiver/node_modules/async/internal/awaitify.js +28 -0
- package/dist/node_modules/archiver/node_modules/async/internal/breakLoop.js +10 -0
- package/dist/node_modules/archiver/node_modules/async/internal/consoleFunc.js +31 -0
- package/dist/node_modules/archiver/node_modules/async/internal/createTester.js +40 -0
- package/dist/node_modules/archiver/node_modules/async/internal/eachOfLimit.js +90 -0
- package/dist/node_modules/archiver/node_modules/async/internal/filter.js +55 -0
- package/dist/node_modules/archiver/node_modules/async/internal/getIterator.js +11 -0
- package/dist/node_modules/archiver/node_modules/async/internal/initialParams.js +14 -0
- package/dist/node_modules/archiver/node_modules/async/internal/isArrayLike.js +10 -0
- package/dist/node_modules/archiver/node_modules/async/internal/iterator.js +57 -0
- package/dist/node_modules/archiver/node_modules/async/internal/map.js +30 -0
- package/dist/node_modules/archiver/node_modules/async/internal/once.js +17 -0
- package/dist/node_modules/archiver/node_modules/async/internal/onlyOnce.js +15 -0
- package/dist/node_modules/archiver/node_modules/async/internal/parallel.js +34 -0
- package/dist/node_modules/archiver/node_modules/async/internal/promiseCallback.js +23 -0
- package/dist/node_modules/archiver/node_modules/async/internal/queue.js +294 -0
- package/dist/node_modules/archiver/node_modules/async/internal/range.js +14 -0
- package/dist/node_modules/archiver/node_modules/async/internal/reject.js +26 -0
- package/dist/node_modules/archiver/node_modules/async/internal/setImmediate.js +34 -0
- package/dist/node_modules/archiver/node_modules/async/internal/withoutIndex.js +10 -0
- package/dist/node_modules/archiver/node_modules/async/internal/wrapAsync.js +34 -0
- package/dist/node_modules/archiver/node_modules/async/log.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/map.js +142 -0
- package/dist/node_modules/archiver/node_modules/async/mapLimit.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/mapSeries.js +44 -0
- package/dist/node_modules/archiver/node_modules/async/mapValues.js +152 -0
- package/dist/node_modules/archiver/node_modules/async/mapValuesLimit.js +61 -0
- package/dist/node_modules/archiver/node_modules/async/mapValuesSeries.js +37 -0
- package/dist/node_modules/archiver/node_modules/async/memoize.js +91 -0
- package/dist/node_modules/archiver/node_modules/async/nextTick.js +52 -0
- package/dist/node_modules/archiver/node_modules/async/package.json +75 -0
- package/dist/node_modules/archiver/node_modules/async/parallel.js +180 -0
- package/dist/node_modules/archiver/node_modules/async/parallelLimit.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/priorityQueue.js +60 -0
- package/dist/node_modules/archiver/node_modules/async/queue.js +24 -0
- package/dist/node_modules/archiver/node_modules/async/race.js +67 -0
- package/dist/node_modules/archiver/node_modules/async/reduce.js +153 -0
- package/dist/node_modules/archiver/node_modules/async/reduceRight.js +41 -0
- package/dist/node_modules/archiver/node_modules/async/reflect.js +78 -0
- package/dist/node_modules/archiver/node_modules/async/reflectAll.js +93 -0
- package/dist/node_modules/archiver/node_modules/async/reject.js +87 -0
- package/dist/node_modules/archiver/node_modules/async/rejectLimit.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/rejectSeries.js +43 -0
- package/dist/node_modules/archiver/node_modules/async/retry.js +159 -0
- package/dist/node_modules/archiver/node_modules/async/retryable.js +77 -0
- package/dist/node_modules/archiver/node_modules/async/select.js +93 -0
- package/dist/node_modules/archiver/node_modules/async/selectLimit.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/selectSeries.js +43 -0
- package/dist/node_modules/archiver/node_modules/async/seq.js +79 -0
- package/dist/node_modules/archiver/node_modules/async/series.js +186 -0
- package/dist/node_modules/archiver/node_modules/async/setImmediate.js +45 -0
- package/dist/node_modules/archiver/node_modules/async/some.js +122 -0
- package/dist/node_modules/archiver/node_modules/async/someLimit.js +47 -0
- package/dist/node_modules/archiver/node_modules/async/someSeries.js +46 -0
- package/dist/node_modules/archiver/node_modules/async/sortBy.js +190 -0
- package/dist/node_modules/archiver/node_modules/async/timeout.js +89 -0
- package/dist/node_modules/archiver/node_modules/async/times.js +50 -0
- package/dist/node_modules/archiver/node_modules/async/timesLimit.js +43 -0
- package/dist/node_modules/archiver/node_modules/async/timesSeries.js +32 -0
- package/dist/node_modules/archiver/node_modules/async/transform.js +173 -0
- package/dist/node_modules/archiver/node_modules/async/tryEach.js +78 -0
- package/dist/node_modules/archiver/node_modules/async/unmemoize.js +25 -0
- package/dist/node_modules/archiver/node_modules/async/until.js +61 -0
- package/dist/node_modules/archiver/node_modules/async/waterfall.js +105 -0
- package/dist/node_modules/archiver/node_modules/async/whilst.js +78 -0
- package/dist/node_modules/archiver/node_modules/async/wrapSync.js +118 -0
- package/dist/node_modules/archiver/package.json +1 -1
- package/dist/node_modules/decompress/index.js +2 -2
- package/dist/node_modules/decompress/package.json +1 -1
- package/dist/node_modules/fs-extra/LICENSE +15 -0
- package/dist/node_modules/fs-extra/lib/copy/copy.js +232 -0
- package/dist/node_modules/fs-extra/lib/copy/index.js +6 -0
- package/dist/node_modules/fs-extra/lib/copy-sync/copy-sync.js +166 -0
- package/dist/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
- package/dist/node_modules/fs-extra/lib/empty/index.js +48 -0
- package/dist/node_modules/fs-extra/lib/ensure/file.js +69 -0
- package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/dist/node_modules/fs-extra/lib/ensure/link.js +61 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
- package/dist/node_modules/fs-extra/lib/fs/index.js +130 -0
- package/dist/node_modules/fs-extra/lib/index.js +1 -0
- package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
- package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +141 -0
- package/dist/node_modules/fs-extra/lib/move/index.js +6 -0
- package/dist/node_modules/fs-extra/lib/move/move.js +65 -0
- package/dist/node_modules/fs-extra/lib/move-sync/index.js +5 -0
- package/dist/node_modules/fs-extra/lib/move-sync/move-sync.js +47 -0
- package/dist/node_modules/fs-extra/lib/output/index.js +40 -0
- package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/dist/node_modules/fs-extra/lib/remove/index.js +9 -0
- package/dist/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +139 -0
- package/dist/node_modules/fs-extra/lib/util/utimes.js +26 -0
- package/dist/node_modules/fs-extra/package.json +1 -0
- package/dist/node_modules/moment/package.json +1 -1
- package/dist/node_modules/semver/bin/semver.js +7 -15
- package/dist/node_modules/semver/classes/range.js +28 -13
- package/dist/node_modules/semver/classes/semver.js +23 -7
- package/dist/node_modules/semver/functions/diff.js +5 -12
- package/dist/node_modules/semver/index.js +1 -1
- package/dist/node_modules/semver/internal/lrucache.js +40 -0
- package/dist/node_modules/semver/internal/re.js +2 -0
- package/dist/node_modules/semver/package.json +1 -1
- package/dist/server/dumper.js +3 -3
- package/package.json +4 -4
- package/dist/client/64214db61c8e2718.js +0 -10
- package/dist/node_modules/decompress/node_modules/make-dir/index.js +0 -85
- package/dist/node_modules/decompress/node_modules/make-dir/license +0 -9
- package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/index.js +0 -84
- package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/license +0 -9
- package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/package.json +0 -51
- package/dist/node_modules/decompress/node_modules/make-dir/package.json +0 -54
- package/dist/node_modules/mkdirp/LICENSE +0 -21
- package/dist/node_modules/mkdirp/bin/cmd.js +0 -68
- package/dist/node_modules/mkdirp/index.js +0 -1
- package/dist/node_modules/mkdirp/lib/find-made.js +0 -29
- package/dist/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
- package/dist/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
- package/dist/node_modules/mkdirp/lib/opts-arg.js +0 -23
- package/dist/node_modules/mkdirp/lib/path-arg.js +0 -29
- package/dist/node_modules/mkdirp/lib/use-native.js +0 -10
- package/dist/node_modules/mkdirp/package.json +0 -1
- package/dist/node_modules/mkdirp/readme.markdown +0 -266
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = until;
|
|
7
|
+
|
|
8
|
+
var _whilst = require('./whilst.js');
|
|
9
|
+
|
|
10
|
+
var _whilst2 = _interopRequireDefault(_whilst);
|
|
11
|
+
|
|
12
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
13
|
+
|
|
14
|
+
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when
|
|
20
|
+
* stopped, or an error occurs. `callback` will be passed an error and any
|
|
21
|
+
* arguments passed to the final `iteratee`'s callback.
|
|
22
|
+
*
|
|
23
|
+
* The inverse of [whilst]{@link module:ControlFlow.whilst}.
|
|
24
|
+
*
|
|
25
|
+
* @name until
|
|
26
|
+
* @static
|
|
27
|
+
* @memberOf module:ControlFlow
|
|
28
|
+
* @method
|
|
29
|
+
* @see [async.whilst]{@link module:ControlFlow.whilst}
|
|
30
|
+
* @category Control Flow
|
|
31
|
+
* @param {AsyncFunction} test - asynchronous truth test to perform before each
|
|
32
|
+
* execution of `iteratee`. Invoked with (callback).
|
|
33
|
+
* @param {AsyncFunction} iteratee - An async function which is called each time
|
|
34
|
+
* `test` fails. Invoked with (callback).
|
|
35
|
+
* @param {Function} [callback] - A callback which is called after the test
|
|
36
|
+
* function has passed and repeated execution of `iteratee` has stopped. `callback`
|
|
37
|
+
* will be passed an error and any arguments passed to the final `iteratee`'s
|
|
38
|
+
* callback. Invoked with (err, [results]);
|
|
39
|
+
* @returns {Promise} a promise, if a callback is not passed
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const results = []
|
|
43
|
+
* let finished = false
|
|
44
|
+
* async.until(function test(cb) {
|
|
45
|
+
* cb(null, finished)
|
|
46
|
+
* }, function iter(next) {
|
|
47
|
+
* fetchPage(url, (err, body) => {
|
|
48
|
+
* if (err) return next(err)
|
|
49
|
+
* results = results.concat(body.objects)
|
|
50
|
+
* finished = !!body.next
|
|
51
|
+
* next(err)
|
|
52
|
+
* })
|
|
53
|
+
* }, function done (err) {
|
|
54
|
+
* // all pages have been fetched
|
|
55
|
+
* })
|
|
56
|
+
*/
|
|
57
|
+
function until(test, iteratee, callback) {
|
|
58
|
+
const _test = (0, _wrapAsync2.default)(test);
|
|
59
|
+
return (0, _whilst2.default)(cb => _test((err, truth) => cb(err, !truth)), iteratee, callback);
|
|
60
|
+
}
|
|
61
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _once = require('./internal/once.js');
|
|
8
|
+
|
|
9
|
+
var _once2 = _interopRequireDefault(_once);
|
|
10
|
+
|
|
11
|
+
var _onlyOnce = require('./internal/onlyOnce.js');
|
|
12
|
+
|
|
13
|
+
var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
|
|
14
|
+
|
|
15
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
16
|
+
|
|
17
|
+
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
18
|
+
|
|
19
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
20
|
+
|
|
21
|
+
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Runs the `tasks` array of functions in series, each passing their results to
|
|
27
|
+
* the next in the array. However, if any of the `tasks` pass an error to their
|
|
28
|
+
* own callback, the next function is not executed, and the main `callback` is
|
|
29
|
+
* immediately called with the error.
|
|
30
|
+
*
|
|
31
|
+
* @name waterfall
|
|
32
|
+
* @static
|
|
33
|
+
* @memberOf module:ControlFlow
|
|
34
|
+
* @method
|
|
35
|
+
* @category Control Flow
|
|
36
|
+
* @param {Array} tasks - An array of [async functions]{@link AsyncFunction}
|
|
37
|
+
* to run.
|
|
38
|
+
* Each function should complete with any number of `result` values.
|
|
39
|
+
* The `result` values will be passed as arguments, in order, to the next task.
|
|
40
|
+
* @param {Function} [callback] - An optional callback to run once all the
|
|
41
|
+
* functions have completed. This will be passed the results of the last task's
|
|
42
|
+
* callback. Invoked with (err, [results]).
|
|
43
|
+
* @returns {Promise} a promise, if a callback is omitted
|
|
44
|
+
* @example
|
|
45
|
+
*
|
|
46
|
+
* async.waterfall([
|
|
47
|
+
* function(callback) {
|
|
48
|
+
* callback(null, 'one', 'two');
|
|
49
|
+
* },
|
|
50
|
+
* function(arg1, arg2, callback) {
|
|
51
|
+
* // arg1 now equals 'one' and arg2 now equals 'two'
|
|
52
|
+
* callback(null, 'three');
|
|
53
|
+
* },
|
|
54
|
+
* function(arg1, callback) {
|
|
55
|
+
* // arg1 now equals 'three'
|
|
56
|
+
* callback(null, 'done');
|
|
57
|
+
* }
|
|
58
|
+
* ], function (err, result) {
|
|
59
|
+
* // result now equals 'done'
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // Or, with named functions:
|
|
63
|
+
* async.waterfall([
|
|
64
|
+
* myFirstFunction,
|
|
65
|
+
* mySecondFunction,
|
|
66
|
+
* myLastFunction,
|
|
67
|
+
* ], function (err, result) {
|
|
68
|
+
* // result now equals 'done'
|
|
69
|
+
* });
|
|
70
|
+
* function myFirstFunction(callback) {
|
|
71
|
+
* callback(null, 'one', 'two');
|
|
72
|
+
* }
|
|
73
|
+
* function mySecondFunction(arg1, arg2, callback) {
|
|
74
|
+
* // arg1 now equals 'one' and arg2 now equals 'two'
|
|
75
|
+
* callback(null, 'three');
|
|
76
|
+
* }
|
|
77
|
+
* function myLastFunction(arg1, callback) {
|
|
78
|
+
* // arg1 now equals 'three'
|
|
79
|
+
* callback(null, 'done');
|
|
80
|
+
* }
|
|
81
|
+
*/
|
|
82
|
+
function waterfall(tasks, callback) {
|
|
83
|
+
callback = (0, _once2.default)(callback);
|
|
84
|
+
if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));
|
|
85
|
+
if (!tasks.length) return callback();
|
|
86
|
+
var taskIndex = 0;
|
|
87
|
+
|
|
88
|
+
function nextTask(args) {
|
|
89
|
+
var task = (0, _wrapAsync2.default)(tasks[taskIndex++]);
|
|
90
|
+
task(...args, (0, _onlyOnce2.default)(next));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function next(err, ...args) {
|
|
94
|
+
if (err === false) return;
|
|
95
|
+
if (err || taskIndex === tasks.length) {
|
|
96
|
+
return callback(err, ...args);
|
|
97
|
+
}
|
|
98
|
+
nextTask(args);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
nextTask([]);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
exports.default = (0, _awaitify2.default)(waterfall);
|
|
105
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _onlyOnce = require('./internal/onlyOnce.js');
|
|
8
|
+
|
|
9
|
+
var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
|
|
10
|
+
|
|
11
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
12
|
+
|
|
13
|
+
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
14
|
+
|
|
15
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
16
|
+
|
|
17
|
+
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when
|
|
23
|
+
* stopped, or an error occurs.
|
|
24
|
+
*
|
|
25
|
+
* @name whilst
|
|
26
|
+
* @static
|
|
27
|
+
* @memberOf module:ControlFlow
|
|
28
|
+
* @method
|
|
29
|
+
* @category Control Flow
|
|
30
|
+
* @param {AsyncFunction} test - asynchronous truth test to perform before each
|
|
31
|
+
* execution of `iteratee`. Invoked with (callback).
|
|
32
|
+
* @param {AsyncFunction} iteratee - An async function which is called each time
|
|
33
|
+
* `test` passes. Invoked with (callback).
|
|
34
|
+
* @param {Function} [callback] - A callback which is called after the test
|
|
35
|
+
* function has failed and repeated execution of `iteratee` has stopped. `callback`
|
|
36
|
+
* will be passed an error and any arguments passed to the final `iteratee`'s
|
|
37
|
+
* callback. Invoked with (err, [results]);
|
|
38
|
+
* @returns {Promise} a promise, if no callback is passed
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* var count = 0;
|
|
42
|
+
* async.whilst(
|
|
43
|
+
* function test(cb) { cb(null, count < 5); },
|
|
44
|
+
* function iter(callback) {
|
|
45
|
+
* count++;
|
|
46
|
+
* setTimeout(function() {
|
|
47
|
+
* callback(null, count);
|
|
48
|
+
* }, 1000);
|
|
49
|
+
* },
|
|
50
|
+
* function (err, n) {
|
|
51
|
+
* // 5 seconds have passed, n = 5
|
|
52
|
+
* }
|
|
53
|
+
* );
|
|
54
|
+
*/
|
|
55
|
+
function whilst(test, iteratee, callback) {
|
|
56
|
+
callback = (0, _onlyOnce2.default)(callback);
|
|
57
|
+
var _fn = (0, _wrapAsync2.default)(iteratee);
|
|
58
|
+
var _test = (0, _wrapAsync2.default)(test);
|
|
59
|
+
var results = [];
|
|
60
|
+
|
|
61
|
+
function next(err, ...rest) {
|
|
62
|
+
if (err) return callback(err);
|
|
63
|
+
results = rest;
|
|
64
|
+
if (err === false) return;
|
|
65
|
+
_test(check);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function check(err, truth) {
|
|
69
|
+
if (err) return callback(err);
|
|
70
|
+
if (err === false) return;
|
|
71
|
+
if (!truth) return callback(null, ...results);
|
|
72
|
+
_fn(next);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return _test(check);
|
|
76
|
+
}
|
|
77
|
+
exports.default = (0, _awaitify2.default)(whilst, 3);
|
|
78
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = asyncify;
|
|
7
|
+
|
|
8
|
+
var _initialParams = require('./internal/initialParams.js');
|
|
9
|
+
|
|
10
|
+
var _initialParams2 = _interopRequireDefault(_initialParams);
|
|
11
|
+
|
|
12
|
+
var _setImmediate = require('./internal/setImmediate.js');
|
|
13
|
+
|
|
14
|
+
var _setImmediate2 = _interopRequireDefault(_setImmediate);
|
|
15
|
+
|
|
16
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Take a sync function and make it async, passing its return value to a
|
|
22
|
+
* callback. This is useful for plugging sync functions into a waterfall,
|
|
23
|
+
* series, or other async functions. Any arguments passed to the generated
|
|
24
|
+
* function will be passed to the wrapped function (except for the final
|
|
25
|
+
* callback argument). Errors thrown will be passed to the callback.
|
|
26
|
+
*
|
|
27
|
+
* If the function passed to `asyncify` returns a Promise, that promises's
|
|
28
|
+
* resolved/rejected state will be used to call the callback, rather than simply
|
|
29
|
+
* the synchronous return value.
|
|
30
|
+
*
|
|
31
|
+
* This also means you can asyncify ES2017 `async` functions.
|
|
32
|
+
*
|
|
33
|
+
* @name asyncify
|
|
34
|
+
* @static
|
|
35
|
+
* @memberOf module:Utils
|
|
36
|
+
* @method
|
|
37
|
+
* @alias wrapSync
|
|
38
|
+
* @category Util
|
|
39
|
+
* @param {Function} func - The synchronous function, or Promise-returning
|
|
40
|
+
* function to convert to an {@link AsyncFunction}.
|
|
41
|
+
* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
|
|
42
|
+
* invoked with `(args..., callback)`.
|
|
43
|
+
* @example
|
|
44
|
+
*
|
|
45
|
+
* // passing a regular synchronous function
|
|
46
|
+
* async.waterfall([
|
|
47
|
+
* async.apply(fs.readFile, filename, "utf8"),
|
|
48
|
+
* async.asyncify(JSON.parse),
|
|
49
|
+
* function (data, next) {
|
|
50
|
+
* // data is the result of parsing the text.
|
|
51
|
+
* // If there was a parsing error, it would have been caught.
|
|
52
|
+
* }
|
|
53
|
+
* ], callback);
|
|
54
|
+
*
|
|
55
|
+
* // passing a function returning a promise
|
|
56
|
+
* async.waterfall([
|
|
57
|
+
* async.apply(fs.readFile, filename, "utf8"),
|
|
58
|
+
* async.asyncify(function (contents) {
|
|
59
|
+
* return db.model.create(contents);
|
|
60
|
+
* }),
|
|
61
|
+
* function (model, next) {
|
|
62
|
+
* // `model` is the instantiated model object.
|
|
63
|
+
* // If there was an error, this function would be skipped.
|
|
64
|
+
* }
|
|
65
|
+
* ], callback);
|
|
66
|
+
*
|
|
67
|
+
* // es2017 example, though `asyncify` is not needed if your JS environment
|
|
68
|
+
* // supports async functions out of the box
|
|
69
|
+
* var q = async.queue(async.asyncify(async function(file) {
|
|
70
|
+
* var intermediateStep = await processFile(file);
|
|
71
|
+
* return await somePromise(intermediateStep)
|
|
72
|
+
* }));
|
|
73
|
+
*
|
|
74
|
+
* q.push(files);
|
|
75
|
+
*/
|
|
76
|
+
function asyncify(func) {
|
|
77
|
+
if ((0, _wrapAsync.isAsync)(func)) {
|
|
78
|
+
return function (...args /*, callback*/) {
|
|
79
|
+
const callback = args.pop();
|
|
80
|
+
const promise = func.apply(this, args);
|
|
81
|
+
return handlePromise(promise, callback);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return (0, _initialParams2.default)(function (args, callback) {
|
|
86
|
+
var result;
|
|
87
|
+
try {
|
|
88
|
+
result = func.apply(this, args);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
return callback(e);
|
|
91
|
+
}
|
|
92
|
+
// if result is Promise object
|
|
93
|
+
if (result && typeof result.then === 'function') {
|
|
94
|
+
return handlePromise(result, callback);
|
|
95
|
+
} else {
|
|
96
|
+
callback(null, result);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function handlePromise(promise, callback) {
|
|
102
|
+
return promise.then(value => {
|
|
103
|
+
invokeCallback(callback, null, value);
|
|
104
|
+
}, err => {
|
|
105
|
+
invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err));
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function invokeCallback(callback, error, value) {
|
|
110
|
+
try {
|
|
111
|
+
callback(error, value);
|
|
112
|
+
} catch (err) {
|
|
113
|
+
(0, _setImmediate2.default)(e => {
|
|
114
|
+
throw e;
|
|
115
|
+
}, err);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
module.exports = exports.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2025-
|
|
1
|
+
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2025-06-03T16:30:28.316Z"}
|