@flemist/test-variants 0.0.11 → 0.0.14
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/bundle/browser.js +74 -31
- package/dist/lib/garbage-collect/garbageCollect.cjs +30 -0
- package/dist/lib/garbage-collect/garbageCollect.d.ts +2 -0
- package/dist/lib/garbage-collect/garbageCollect.mjs +26 -0
- package/dist/lib/index.cjs +2 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/test-variants/createTestVariants.cjs +58 -47
- package/dist/lib/test-variants/createTestVariants.d.ts +6 -3
- package/dist/lib/test-variants/createTestVariants.mjs +58 -47
- package/dist/lib/test-variants/createTestVariants.perf.cjs +2 -0
- package/dist/lib/test-variants/createTestVariants.perf.mjs +2 -0
- package/package.json +1 -1
package/dist/bundle/browser.js
CHANGED
|
@@ -1,33 +1,76 @@
|
|
|
1
|
-
!function(e){"use strict"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
;
|
|
20
|
-
|
|
21
|
-
;
|
|
22
|
-
|
|
23
|
-
;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
!function(e){"use strict";function n(e,n,t,r){
|
|
2
|
+
return new(t||(t=Promise))((function(o,u){
|
|
3
|
+
function a(e){try{c(r.next(e))}catch(e){u(e)}}
|
|
4
|
+
function i(e){try{c(r.throw(e))}catch(e){u(e)}}
|
|
5
|
+
function c(e){var n
|
|
6
|
+
;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){
|
|
7
|
+
e(n)}))).then(a,i)}c((r=r.apply(e,n||[])).next())
|
|
8
|
+
}))}function t(e,n){var t,r,o,u,a={label:0,
|
|
9
|
+
sent:function(){if(1&o[0])throw o[1];return o[1]},
|
|
10
|
+
trys:[],ops:[]};return u={next:i(0),throw:i(1),
|
|
11
|
+
return:i(2)
|
|
12
|
+
},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){
|
|
13
|
+
return this}),u;function i(u){return function(i){
|
|
14
|
+
return function(u){
|
|
15
|
+
if(t)throw new TypeError("Generator is already executing.")
|
|
16
|
+
;for(;a;)try{
|
|
17
|
+
if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),
|
|
18
|
+
0):r.next)&&!(o=o.call(r,u[1])).done)return o
|
|
19
|
+
;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:
|
|
20
|
+
case 1:o=u;break;case 4:return a.label++,{
|
|
21
|
+
value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0]
|
|
22
|
+
;continue;case 7:u=a.ops.pop(),a.trys.pop()
|
|
23
|
+
;continue;default:
|
|
24
|
+
if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){
|
|
25
|
+
a=0;continue}
|
|
26
|
+
if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){
|
|
27
|
+
a.label=u[1];break}if(6===u[0]&&a.label<o[1]){
|
|
28
|
+
a.label=o[1],o=u;break}if(o&&a.label<o[2]){
|
|
29
|
+
a.label=o[2],a.ops.push(u);break}
|
|
30
|
+
o[2]&&a.ops.pop(),a.trys.pop();continue}
|
|
31
|
+
u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}
|
|
32
|
+
if(5&u[0])throw u[1];return{
|
|
33
|
+
value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}
|
|
34
|
+
function r(e){
|
|
35
|
+
if(null==e||e<=0)throw new Error("Iterations = ".concat(e))
|
|
36
|
+
;e--;var n=new Promise((function(n){
|
|
37
|
+
setTimeout((function(){n(e)}),1)}))
|
|
38
|
+
;return e<=0?n:n.then(r)}
|
|
39
|
+
e.createTestVariants=function(e){
|
|
40
|
+
return function(o){return function(u){
|
|
41
|
+
var a=void 0===u?{}:u,i=a.GC_Iterations,c=void 0===i?1e6:i,s=a.GC_IterationsAsync,l=void 0===s?1e4:s,f=a.GC_Interval,v=void 0===f?1e3:f,h=a.logInterval,b=void 0===h?5e3:h,p=a.logCompleted,y=void 0===p||p,d=Object.keys(o),w=Object.values(o),g=d.length,m={}
|
|
42
|
+
;function I(e){var n=w[e]
|
|
43
|
+
;return"function"==typeof n&&(n=n(m)),n}
|
|
44
|
+
for(var k=[],x=[],D=0;D<g;D++)k[D]=-1,x[D]=[]
|
|
45
|
+
;x[0]=I(0);var G=0,O=0,T=!1,_=0;function j(e){
|
|
46
|
+
return n(this,void 0,void 0,(function(){var n
|
|
47
|
+
;return t(this,(function(t){switch(t.label){
|
|
48
|
+
case 0:
|
|
49
|
+
return console.error(JSON.stringify(m,null,2)),console.error(e),n=Date.now(),
|
|
50
|
+
Date.now()-n>50&&_<5?(console.log("DEBUG ITERATION: "+_),
|
|
51
|
+
T=!0,[4,A()]):[3,2];case 1:t.sent(),_++,t.label=2
|
|
52
|
+
;case 2:throw e}}))}))}
|
|
53
|
+
var C=Date.now(),E=C,P=G,S=O;function A(){
|
|
54
|
+
return n(this,void 0,void 0,(function(){
|
|
55
|
+
var n,o,u,a;return t(this,(function(t){
|
|
56
|
+
switch(t.label){case 0:
|
|
57
|
+
t.trys.push([0,7,,9]),t.label=1;case 1:
|
|
58
|
+
return T||function(){for(var e=g-1;e>=0;e--){
|
|
59
|
+
var n=k[e]+1;if(n<x[e].length){
|
|
60
|
+
for(k[e]=n,m[d[e]]=x[e][n],e++;e<g;e++){var t=I(e)
|
|
61
|
+
;if(0===t.length)break;k[e]=0,x[e]=t,m[d[e]]=t[0]}
|
|
62
|
+
if(e>=g)return!0}}return!1
|
|
63
|
+
}()?(n=(b||v)&&Date.now(),b&&n-C>=b&&(console.log(G),C=n),
|
|
64
|
+
c&&G-P>=c||l&&O-S>=l||v&&n-E>=v?(P=G,
|
|
65
|
+
S=O,E=n,[4,r(1)]):[3,3]):[3,6];case 2:
|
|
66
|
+
return t.sent(),[3,1];case 3:
|
|
67
|
+
return"object"==typeof(o=e(m))&&o&&"function"==typeof o.then?[4,o]:[3,5]
|
|
68
|
+
;case 4:
|
|
69
|
+
return u=t.sent(),O+=a="number"==typeof u?u:1,G+=a,[3,1]
|
|
70
|
+
;case 5:return G+="number"==typeof o?o:1,[3,1]
|
|
71
|
+
;case 6:return[3,9];case 7:return[4,j(t.sent())]
|
|
72
|
+
;case 8:return t.sent(),[3,9];case 9:
|
|
73
|
+
return y&&console.log("variants: "+G),[4,r(1)]
|
|
74
|
+
;case 10:return t.sent(),[2,G]}}))}))}return A()}}
|
|
32
75
|
},Object.defineProperty(e,"__esModule",{value:!0})
|
|
33
76
|
}({});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
/** Wait for garbage collection and return 0. It may be required for very long calculations. */
|
|
6
|
+
function garbageCollect(iterations) {
|
|
7
|
+
if (iterations == null || iterations <= 0) {
|
|
8
|
+
throw new Error(`Iterations = ${iterations}`);
|
|
9
|
+
}
|
|
10
|
+
iterations--;
|
|
11
|
+
// const time0 = Date.now()
|
|
12
|
+
const promise = new Promise(resolve => {
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
resolve(iterations);
|
|
15
|
+
}, 1);
|
|
16
|
+
});
|
|
17
|
+
return iterations <= 0
|
|
18
|
+
? promise
|
|
19
|
+
: promise.then(garbageCollect);
|
|
20
|
+
// : promise.then(o => {
|
|
21
|
+
// const gcTime = Date.now() - time0
|
|
22
|
+
// if (gcTime > 50) {
|
|
23
|
+
// console.log('GC time: ' + gcTime)
|
|
24
|
+
// o++
|
|
25
|
+
// }
|
|
26
|
+
// return garbageCollect(o)
|
|
27
|
+
// })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.garbageCollect = garbageCollect;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Wait for garbage collection and return 0. It may be required for very long calculations. */
|
|
2
|
+
function garbageCollect(iterations) {
|
|
3
|
+
if (iterations == null || iterations <= 0) {
|
|
4
|
+
throw new Error(`Iterations = ${iterations}`);
|
|
5
|
+
}
|
|
6
|
+
iterations--;
|
|
7
|
+
// const time0 = Date.now()
|
|
8
|
+
const promise = new Promise(resolve => {
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
resolve(iterations);
|
|
11
|
+
}, 1);
|
|
12
|
+
});
|
|
13
|
+
return iterations <= 0
|
|
14
|
+
? promise
|
|
15
|
+
: promise.then(garbageCollect);
|
|
16
|
+
// : promise.then(o => {
|
|
17
|
+
// const gcTime = Date.now() - time0
|
|
18
|
+
// if (gcTime > 50) {
|
|
19
|
+
// console.log('GC time: ' + gcTime)
|
|
20
|
+
// o++
|
|
21
|
+
// }
|
|
22
|
+
// return garbageCollect(o)
|
|
23
|
+
// })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { garbageCollect };
|
package/dist/lib/index.cjs
CHANGED
package/dist/lib/index.mjs
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var garbageCollect_garbageCollect = require('../garbage-collect/garbageCollect.cjs');
|
|
7
|
+
|
|
5
8
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
6
9
|
function createTestVariants(test) {
|
|
7
10
|
return function testVariantsArgs(args) {
|
|
8
|
-
return function testVariantsCall({
|
|
11
|
+
return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, } = {}) {
|
|
9
12
|
const argsKeys = Object.keys(args);
|
|
10
13
|
const argsValues = Object.values(args);
|
|
11
14
|
const argsLength = argsKeys.length;
|
|
@@ -47,22 +50,25 @@ function createTestVariants(test) {
|
|
|
47
50
|
return false;
|
|
48
51
|
}
|
|
49
52
|
let iterations = 0;
|
|
53
|
+
let iterationsAsync = 0;
|
|
50
54
|
let debug = false;
|
|
51
55
|
let debugIteration = 0;
|
|
52
56
|
function onError(err) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
console.error(JSON.stringify(variantArgs, null, 2));
|
|
59
|
+
console.error(err);
|
|
60
|
+
// rerun failed variant 5 times for debug
|
|
61
|
+
const time0 = Date.now();
|
|
62
|
+
// eslint-disable-next-line no-debugger
|
|
63
|
+
debugger;
|
|
64
|
+
if (Date.now() - time0 > 50 && debugIteration < 5) {
|
|
65
|
+
console.log('DEBUG ITERATION: ' + debugIteration);
|
|
66
|
+
debug = true;
|
|
67
|
+
yield next();
|
|
68
|
+
debugIteration++;
|
|
69
|
+
}
|
|
70
|
+
throw err;
|
|
71
|
+
});
|
|
66
72
|
}
|
|
67
73
|
function onCompleted() {
|
|
68
74
|
if (logCompleted) {
|
|
@@ -70,45 +76,50 @@ function createTestVariants(test) {
|
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
let prevLogTime = Date.now();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log(iterations);
|
|
79
|
-
prevLogTime = now;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
iterations += typeof value === 'number' ? value : 1;
|
|
83
|
-
const syncCallStartTime = pauseInterval && now;
|
|
84
|
-
while (debug || nextVariant()) {
|
|
79
|
+
let prevGC_Time = prevLogTime;
|
|
80
|
+
let prevGC_Iterations = iterations;
|
|
81
|
+
let prevGC_IterationsAsync = iterationsAsync;
|
|
82
|
+
function next() {
|
|
83
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
85
84
|
try {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
&&
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
while (debug || nextVariant()) {
|
|
86
|
+
const now = (logInterval || GC_Interval) && Date.now();
|
|
87
|
+
if (logInterval && now - prevLogTime >= logInterval) {
|
|
88
|
+
// the log is required to prevent the karma browserNoActivityTimeout
|
|
89
|
+
console.log(iterations);
|
|
90
|
+
prevLogTime = now;
|
|
91
|
+
}
|
|
92
|
+
if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
|
|
93
|
+
|| GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
|
|
94
|
+
|| GC_Interval && now - prevGC_Time >= GC_Interval) {
|
|
95
|
+
prevGC_Iterations = iterations;
|
|
96
|
+
prevGC_IterationsAsync = iterationsAsync;
|
|
97
|
+
prevGC_Time = now;
|
|
98
|
+
yield garbageCollect_garbageCollect.garbageCollect(1);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const promiseOrIterations = test(variantArgs);
|
|
102
|
+
if (typeof promiseOrIterations === 'object'
|
|
103
|
+
&& promiseOrIterations
|
|
104
|
+
&& typeof promiseOrIterations.then === 'function') {
|
|
105
|
+
const value = yield promiseOrIterations;
|
|
106
|
+
const newIterations = typeof value === 'number' ? value : 1;
|
|
107
|
+
iterationsAsync += newIterations;
|
|
108
|
+
iterations += newIterations;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
|
|
101
112
|
}
|
|
102
|
-
iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
|
|
103
113
|
}
|
|
104
114
|
catch (err) {
|
|
105
|
-
onError(err);
|
|
115
|
+
yield onError(err);
|
|
106
116
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
onCompleted();
|
|
118
|
+
yield garbageCollect_garbageCollect.garbageCollect(1);
|
|
119
|
+
return iterations;
|
|
120
|
+
});
|
|
110
121
|
}
|
|
111
|
-
return next(
|
|
122
|
+
return next();
|
|
112
123
|
};
|
|
113
124
|
};
|
|
114
125
|
}
|
|
@@ -7,9 +7,12 @@ declare type TestVariantsSetArgs<TArgs> = <TAdditionalArgs>(args: VariantsArgs<{
|
|
|
7
7
|
[key in (keyof TAdditionalArgs | keyof TArgs)]: key extends keyof TArgs ? TArgs[key] : key extends keyof TAdditionalArgs ? TAdditionalArgs[key] : never;
|
|
8
8
|
}>) => TestVariantsCall;
|
|
9
9
|
export declare type TestVariantsCallParams = {
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/** Wait for garbage collection after iterations */
|
|
11
|
+
GC_Iterations?: number;
|
|
12
|
+
/** Same as GC_Iterations but only for async test variants, required for 10000 and more of Promise rejections */
|
|
13
|
+
GC_IterationsAsync?: number;
|
|
14
|
+
/** Wait for garbage collection after time interval, required to prevent the karma browserDisconnectTimeout */
|
|
15
|
+
GC_Interval?: number;
|
|
13
16
|
/** console log current iterations, required to prevent the karma browserNoActivityTimeout */
|
|
14
17
|
logInterval?: number;
|
|
15
18
|
/** console log iterations on test completed */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { garbageCollect } from '../garbage-collect/garbageCollect.mjs';
|
|
3
|
+
|
|
1
4
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
2
5
|
function createTestVariants(test) {
|
|
3
6
|
return function testVariantsArgs(args) {
|
|
4
|
-
return function testVariantsCall({
|
|
7
|
+
return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, } = {}) {
|
|
5
8
|
const argsKeys = Object.keys(args);
|
|
6
9
|
const argsValues = Object.values(args);
|
|
7
10
|
const argsLength = argsKeys.length;
|
|
@@ -43,22 +46,25 @@ function createTestVariants(test) {
|
|
|
43
46
|
return false;
|
|
44
47
|
}
|
|
45
48
|
let iterations = 0;
|
|
49
|
+
let iterationsAsync = 0;
|
|
46
50
|
let debug = false;
|
|
47
51
|
let debugIteration = 0;
|
|
48
52
|
function onError(err) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
console.error(JSON.stringify(variantArgs, null, 2));
|
|
55
|
+
console.error(err);
|
|
56
|
+
// rerun failed variant 5 times for debug
|
|
57
|
+
const time0 = Date.now();
|
|
58
|
+
// eslint-disable-next-line no-debugger
|
|
59
|
+
debugger;
|
|
60
|
+
if (Date.now() - time0 > 50 && debugIteration < 5) {
|
|
61
|
+
console.log('DEBUG ITERATION: ' + debugIteration);
|
|
62
|
+
debug = true;
|
|
63
|
+
yield next();
|
|
64
|
+
debugIteration++;
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
});
|
|
62
68
|
}
|
|
63
69
|
function onCompleted() {
|
|
64
70
|
if (logCompleted) {
|
|
@@ -66,45 +72,50 @@ function createTestVariants(test) {
|
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
let prevLogTime = Date.now();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
console.log(iterations);
|
|
75
|
-
prevLogTime = now;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
iterations += typeof value === 'number' ? value : 1;
|
|
79
|
-
const syncCallStartTime = pauseInterval && now;
|
|
80
|
-
while (debug || nextVariant()) {
|
|
75
|
+
let prevGC_Time = prevLogTime;
|
|
76
|
+
let prevGC_Iterations = iterations;
|
|
77
|
+
let prevGC_IterationsAsync = iterationsAsync;
|
|
78
|
+
function next() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
80
|
try {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
&&
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
81
|
+
while (debug || nextVariant()) {
|
|
82
|
+
const now = (logInterval || GC_Interval) && Date.now();
|
|
83
|
+
if (logInterval && now - prevLogTime >= logInterval) {
|
|
84
|
+
// the log is required to prevent the karma browserNoActivityTimeout
|
|
85
|
+
console.log(iterations);
|
|
86
|
+
prevLogTime = now;
|
|
87
|
+
}
|
|
88
|
+
if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
|
|
89
|
+
|| GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
|
|
90
|
+
|| GC_Interval && now - prevGC_Time >= GC_Interval) {
|
|
91
|
+
prevGC_Iterations = iterations;
|
|
92
|
+
prevGC_IterationsAsync = iterationsAsync;
|
|
93
|
+
prevGC_Time = now;
|
|
94
|
+
yield garbageCollect(1);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const promiseOrIterations = test(variantArgs);
|
|
98
|
+
if (typeof promiseOrIterations === 'object'
|
|
99
|
+
&& promiseOrIterations
|
|
100
|
+
&& typeof promiseOrIterations.then === 'function') {
|
|
101
|
+
const value = yield promiseOrIterations;
|
|
102
|
+
const newIterations = typeof value === 'number' ? value : 1;
|
|
103
|
+
iterationsAsync += newIterations;
|
|
104
|
+
iterations += newIterations;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
|
|
97
108
|
}
|
|
98
|
-
iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
|
|
99
109
|
}
|
|
100
110
|
catch (err) {
|
|
101
|
-
onError(err);
|
|
111
|
+
yield onError(err);
|
|
102
112
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
onCompleted();
|
|
114
|
+
yield garbageCollect(1);
|
|
115
|
+
return iterations;
|
|
116
|
+
});
|
|
106
117
|
}
|
|
107
|
-
return next(
|
|
118
|
+
return next();
|
|
108
119
|
};
|
|
109
120
|
};
|
|
110
121
|
}
|
package/package.json
CHANGED