@nocobase/plugin-backup-restore 1.6.20 → 1.6.21
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/d0c15e9119b8e3d3.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/package.json +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- 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/package.json +3 -3
- package/dist/client/04e68bac2ed0170d.js +0 -10
|
@@ -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-04-
|
|
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-04-17T07:01:37.326Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2025-04-
|
|
1
|
+
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2025-04-17T07:01:38.706Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2025-04-
|
|
1
|
+
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2025-04-17T07:01:37.424Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2025-04-
|
|
1
|
+
{"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2025-04-17T07:01:37.935Z"}
|
|
@@ -61,6 +61,7 @@ const main = () => {
|
|
|
61
61
|
switch (argv[0]) {
|
|
62
62
|
case 'major': case 'minor': case 'patch': case 'prerelease':
|
|
63
63
|
case 'premajor': case 'preminor': case 'prepatch':
|
|
64
|
+
case 'release':
|
|
64
65
|
inc = argv.shift()
|
|
65
66
|
break
|
|
66
67
|
default:
|
|
@@ -119,7 +120,11 @@ const main = () => {
|
|
|
119
120
|
return fail()
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
+
versions
|
|
124
|
+
.sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
|
|
125
|
+
.map(v => semver.clean(v, options))
|
|
126
|
+
.map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
|
|
127
|
+
.forEach(v => console.log(v))
|
|
123
128
|
}
|
|
124
129
|
|
|
125
130
|
const failInc = () => {
|
|
@@ -129,19 +134,6 @@ const failInc = () => {
|
|
|
129
134
|
|
|
130
135
|
const fail = () => process.exit(1)
|
|
131
136
|
|
|
132
|
-
const success = () => {
|
|
133
|
-
const compare = reverse ? 'rcompare' : 'compare'
|
|
134
|
-
versions.sort((a, b) => {
|
|
135
|
-
return semver[compare](a, b, options)
|
|
136
|
-
}).map((v) => {
|
|
137
|
-
return semver.clean(v, options)
|
|
138
|
-
}).map((v) => {
|
|
139
|
-
return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
|
|
140
|
-
}).forEach((v, i, _) => {
|
|
141
|
-
console.log(v)
|
|
142
|
-
})
|
|
143
|
-
}
|
|
144
|
-
|
|
145
137
|
const help = () => console.log(
|
|
146
138
|
`SemVer ${version}
|
|
147
139
|
|
|
@@ -158,7 +150,7 @@ Options:
|
|
|
158
150
|
-i --increment [<level>]
|
|
159
151
|
Increment a version by the specified level. Level can
|
|
160
152
|
be one of: major, minor, patch, premajor, preminor,
|
|
161
|
-
prepatch, or
|
|
153
|
+
prepatch, prerelease, or release. Default level is 'patch'.
|
|
162
154
|
Only one version may be specified.
|
|
163
155
|
|
|
164
156
|
--preid <identifier>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const SPACE_CHARACTERS = /\s+/g
|
|
2
|
+
|
|
1
3
|
// hoisted class for cyclic dependency
|
|
2
4
|
class Range {
|
|
3
5
|
constructor (range, options) {
|
|
@@ -18,7 +20,7 @@ class Range {
|
|
|
18
20
|
// just put it in the set and return
|
|
19
21
|
this.raw = range.value
|
|
20
22
|
this.set = [[range]]
|
|
21
|
-
this.
|
|
23
|
+
this.formatted = undefined
|
|
22
24
|
return this
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -29,10 +31,7 @@ class Range {
|
|
|
29
31
|
// First reduce all whitespace as much as possible so we do not have to rely
|
|
30
32
|
// on potentially slow regexes like \s*. This is then stored and used for
|
|
31
33
|
// future error messages as well.
|
|
32
|
-
this.raw = range
|
|
33
|
-
.trim()
|
|
34
|
-
.split(/\s+/)
|
|
35
|
-
.join(' ')
|
|
34
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
|
|
36
35
|
|
|
37
36
|
// First, split on ||
|
|
38
37
|
this.set = this.raw
|
|
@@ -66,14 +65,29 @@ class Range {
|
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
this.
|
|
68
|
+
this.formatted = undefined
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get range () {
|
|
72
|
+
if (this.formatted === undefined) {
|
|
73
|
+
this.formatted = ''
|
|
74
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
75
|
+
if (i > 0) {
|
|
76
|
+
this.formatted += '||'
|
|
77
|
+
}
|
|
78
|
+
const comps = this.set[i]
|
|
79
|
+
for (let k = 0; k < comps.length; k++) {
|
|
80
|
+
if (k > 0) {
|
|
81
|
+
this.formatted += ' '
|
|
82
|
+
}
|
|
83
|
+
this.formatted += comps[k].toString().trim()
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return this.formatted
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
format () {
|
|
73
|
-
this.range = this.set
|
|
74
|
-
.map((comps) => comps.join(' ').trim())
|
|
75
|
-
.join('||')
|
|
76
|
-
.trim()
|
|
77
91
|
return this.range
|
|
78
92
|
}
|
|
79
93
|
|
|
@@ -198,8 +212,8 @@ class Range {
|
|
|
198
212
|
|
|
199
213
|
module.exports = Range
|
|
200
214
|
|
|
201
|
-
const LRU = require('
|
|
202
|
-
const cache = new LRU(
|
|
215
|
+
const LRU = require('../internal/lrucache')
|
|
216
|
+
const cache = new LRU()
|
|
203
217
|
|
|
204
218
|
const parseOptions = require('../internal/parse-options')
|
|
205
219
|
const Comparator = require('./comparator')
|
|
@@ -470,9 +484,10 @@ const replaceGTE0 = (comp, options) => {
|
|
|
470
484
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
471
485
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
472
486
|
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
487
|
+
// TODO build?
|
|
473
488
|
const hyphenReplace = incPr => ($0,
|
|
474
489
|
from, fM, fm, fp, fpr, fb,
|
|
475
|
-
to, tM, tm, tp, tpr
|
|
490
|
+
to, tM, tm, tp, tpr) => {
|
|
476
491
|
if (isX(fM)) {
|
|
477
492
|
from = ''
|
|
478
493
|
} else if (isX(fm)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const debug = require('../internal/debug')
|
|
2
2
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
|
3
|
-
const { safeRe: re, t } = require('../internal/re')
|
|
3
|
+
const { safeRe: re, safeSrc: src, t } = require('../internal/re')
|
|
4
4
|
|
|
5
5
|
const parseOptions = require('../internal/parse-options')
|
|
6
6
|
const { compareIdentifiers } = require('../internal/identifiers')
|
|
@@ -10,7 +10,7 @@ class SemVer {
|
|
|
10
10
|
|
|
11
11
|
if (version instanceof SemVer) {
|
|
12
12
|
if (version.loose === !!options.loose &&
|
|
13
|
-
|
|
13
|
+
version.includePrerelease === !!options.includePrerelease) {
|
|
14
14
|
return version
|
|
15
15
|
} else {
|
|
16
16
|
version = version.version
|
|
@@ -158,7 +158,7 @@ class SemVer {
|
|
|
158
158
|
do {
|
|
159
159
|
const a = this.build[i]
|
|
160
160
|
const b = other.build[i]
|
|
161
|
-
debug('
|
|
161
|
+
debug('build compare', i, a, b)
|
|
162
162
|
if (a === undefined && b === undefined) {
|
|
163
163
|
return 0
|
|
164
164
|
} else if (b === undefined) {
|
|
@@ -176,6 +176,20 @@ class SemVer {
|
|
|
176
176
|
// preminor will bump the version up to the next minor release, and immediately
|
|
177
177
|
// down to pre-release. premajor and prepatch work the same way.
|
|
178
178
|
inc (release, identifier, identifierBase) {
|
|
179
|
+
if (release.startsWith('pre')) {
|
|
180
|
+
if (!identifier && identifierBase === false) {
|
|
181
|
+
throw new Error('invalid increment argument: identifier is empty')
|
|
182
|
+
}
|
|
183
|
+
// Avoid an invalid semver results
|
|
184
|
+
if (identifier) {
|
|
185
|
+
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`)
|
|
186
|
+
const match = `-${identifier}`.match(r)
|
|
187
|
+
if (!match || match[1] !== identifier) {
|
|
188
|
+
throw new Error(`invalid identifier: ${identifier}`)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
179
193
|
switch (release) {
|
|
180
194
|
case 'premajor':
|
|
181
195
|
this.prerelease.length = 0
|
|
@@ -206,6 +220,12 @@ class SemVer {
|
|
|
206
220
|
}
|
|
207
221
|
this.inc('pre', identifier, identifierBase)
|
|
208
222
|
break
|
|
223
|
+
case 'release':
|
|
224
|
+
if (this.prerelease.length === 0) {
|
|
225
|
+
throw new Error(`version ${this.raw} is not a prerelease`)
|
|
226
|
+
}
|
|
227
|
+
this.prerelease.length = 0
|
|
228
|
+
break
|
|
209
229
|
|
|
210
230
|
case 'major':
|
|
211
231
|
// If this is a pre-major version, bump up to the same major version.
|
|
@@ -249,10 +269,6 @@ class SemVer {
|
|
|
249
269
|
case 'pre': {
|
|
250
270
|
const base = Number(identifierBase) ? 1 : 0
|
|
251
271
|
|
|
252
|
-
if (!identifier && identifierBase === false) {
|
|
253
|
-
throw new Error('invalid increment argument: identifier is empty')
|
|
254
|
-
}
|
|
255
|
-
|
|
256
272
|
if (this.prerelease.length === 0) {
|
|
257
273
|
this.prerelease = [base]
|
|
258
274
|
} else {
|
|
@@ -27,20 +27,13 @@ const diff = (version1, version2) => {
|
|
|
27
27
|
return 'major'
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
// If the main part has no difference
|
|
31
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
32
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
33
|
+
return 'minor'
|
|
34
|
+
}
|
|
34
35
|
return 'patch'
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
if (highVersion.minor) {
|
|
38
|
-
// anything higher than a minor bump would result in the wrong version
|
|
39
|
-
return 'minor'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// bumping major/minor/patch all have same result
|
|
43
|
-
return 'major'
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
// add the `pre` prefix if we are going to a prerelease version
|