@flemist/test-variants 1.0.0 → 1.0.3

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.
@@ -1,80 +1,322 @@
1
- !function(e){"use strict";function n(e,n,t,r){
2
- return new(t||(t=Promise))((function(o,a){
3
- function i(e){try{c(r.next(e))}catch(e){a(e)}}
4
- function u(e){try{c(r.throw(e))}catch(e){a(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(i,u)}c((r=r.apply(e,n||[])).next())
8
- }))}function t(e,n){var t,r,o,a,i={label:0,
9
- sent:function(){if(1&o[0])throw o[1];return o[1]},
10
- trys:[],ops:[]};return a={next:u(0),throw:u(1),
11
- return:u(2)
12
- },"function"==typeof Symbol&&(a[Symbol.iterator]=function(){
13
- return this}),a;function u(a){return function(u){
14
- return function(a){
15
- if(t)throw new TypeError("Generator is already executing.")
16
- ;for(;i;)try{
17
- if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),
18
- 0):r.next)&&!(o=o.call(r,a[1])).done)return o
19
- ;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:
20
- case 1:o=a;break;case 4:return i.label++,{
21
- value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0]
22
- ;continue;case 7:a=i.ops.pop(),i.trys.pop()
1
+ !function(t){"use strict";var e=function(){
2
+ return e=Object.assign||function(t){
3
+ for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])
4
+ ;return t},e.apply(this,arguments)}
5
+ ;function n(t,e,n,r){
6
+ return new(n||(n=Promise))((function(s,i){
7
+ function o(t){try{c(r.next(t))}catch(t){i(t)}}
8
+ function l(t){try{c(r.throw(t))}catch(t){i(t)}}
9
+ function c(t){var e
10
+ ;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){
11
+ t(e)}))).then(o,l)}c((r=r.apply(t,e||[])).next())
12
+ }))}function r(t,e){var n,r,s,i,o={label:0,
13
+ sent:function(){if(1&s[0])throw s[1];return s[1]},
14
+ trys:[],ops:[]};return i={next:l(0),throw:l(1),
15
+ return:l(2)
16
+ },"function"==typeof Symbol&&(i[Symbol.iterator]=function(){
17
+ return this}),i;function l(i){return function(l){
18
+ return function(i){
19
+ if(n)throw new TypeError("Generator is already executing.")
20
+ ;for(;o;)try{
21
+ if(n=1,r&&(s=2&i[0]?r.return:i[0]?r.throw||((s=r.return)&&s.call(r),
22
+ 0):r.next)&&!(s=s.call(r,i[1])).done)return s
23
+ ;switch(r=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:
24
+ case 1:s=i;break;case 4:return o.label++,{
25
+ value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0]
26
+ ;continue;case 7:i=o.ops.pop(),o.trys.pop()
23
27
  ;continue;default:
24
- if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){
25
- i=0;continue}
26
- if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){
27
- i.label=a[1];break}if(6===a[0]&&i.label<o[1]){
28
- i.label=o[1],o=a;break}if(o&&i.label<o[2]){
29
- i.label=o[2],i.ops.push(a);break}
30
- o[2]&&i.ops.pop(),i.trys.pop();continue}
31
- a=n.call(e,i)}catch(e){a=[6,e],r=0}finally{t=o=0}
32
- if(5&a[0])throw a[1];return{
33
- value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}
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(a){
41
- var i=void 0===a?{}:a,u=i.GC_Iterations,c=void 0===u?1e6:u,l=i.GC_IterationsAsync,s=void 0===l?1e4:l,f=i.GC_Interval,v=void 0===f?1e3:f,h=i.logInterval,b=void 0===h?5e3:h,d=i.logCompleted,p=void 0===d||d,y=i.onError,w=void 0===y?null:y,g=i.abortSignal,m=Object.keys(o),I=Object.values(o),k=m.length,x={}
42
- ;function D(e){var n=I[e]
43
- ;return"function"==typeof n&&(n=n(x)),n}
44
- for(var E=[],G=[],O=0;O<k;O++)E[O]=-1,G[O]=[]
45
- ;G[0]=D(0);var T=0,_=0,j=!1,C=0;function S(e){
28
+ if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){
29
+ o=0;continue}
30
+ if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){
31
+ o.label=i[1];break}if(6===i[0]&&o.label<s[1]){
32
+ o.label=s[1],s=i;break}if(s&&o.label<s[2]){
33
+ o.label=s[2],o.ops.push(i);break}
34
+ s[2]&&o.ops.pop(),o.trys.pop();continue}
35
+ i=e.call(t,o)}catch(t){i=[6,t],r=0}finally{n=s=0}
36
+ if(5&i[0])throw i[1];return{
37
+ value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}
38
+ function s(t){
39
+ if(null==t||t<=0)throw new Error("Iterations = ".concat(t))
40
+ ;t--;var e=new Promise((function(e){
41
+ setTimeout((function(){e(t)}),1)}))
42
+ ;return t<=0?e:e.then(s)}class i extends Error{
43
+ constructor(t,e){
44
+ super(t),Object.setPrototypeOf(this,i.prototype),this.reason=e,
45
+ this.name="AbortError",this._internal=!1}}
46
+ const o=()=>{};class l{constructor(){
47
+ this.aborted=!1,this.reason=void 0,this._callbacks=void 0
48
+ }subscribe(t){var e
49
+ ;if(null===(e=this._callbacks)||void 0===e?void 0:e.has(t))throw new Error("Already subscribed: "+t)
50
+ ;return this.aborted?(t.call(this,this.reason),
51
+ o):(this._callbacks||(this._callbacks=new Set),
52
+ this._callbacks.add(t),()=>{var e
53
+ ;null===(e=this._callbacks)||void 0===e||e.delete(t)
54
+ })}abort(t){var e
55
+ ;this.aborted=!0,this.reason=t,null===(e=this._callbacks)||void 0===e||e.forEach((t=>{
56
+ t.call(this,this.reason)})),this._callbacks=void 0
57
+ }throwIfAborted(){
58
+ if(this.aborted)throw this.reason}}class c{
59
+ constructor(){this.signal=new l}abort(t){
60
+ this.signal.aborted||(void 0===t&&((t=new i("Aborted with no reason",t))._internal=!0),
61
+ this.signal.abort(t))}}function u(t,e){return t<e}
62
+ class a{
63
+ constructor({objectPool:t,lessThanFunc:e}={}){
64
+ this._size=0,this._root=null,this.merge=h,
65
+ this.collapse=f,this._objectPool=t,this._lessThanFunc=e||u
66
+ }clear(){this._root=null,this._size=0}get size(){
67
+ return this._size}add(t){
68
+ let e=null!=this._objectPool?this._objectPool.get():null
69
+ ;return null==e?e={child:null,next:null,prev:null,
70
+ item:t
71
+ }:e.item=t,this._size++,this._root=h(this._root,e,this._lessThanFunc),e
72
+ }getMin(){const{_root:t}=this
73
+ ;return null==t?void 0:t.item}getMinNode(){
74
+ return this._root}deleteMin(){const{_root:t}=this
75
+ ;if(null==t)return;const e=t.item
76
+ ;return this.delete(t),e}delete(t){var e
77
+ ;if(t===this._root)this._root=f(t.child,this._lessThanFunc);else{
78
+ if(null==t.prev){
79
+ if(this._objectPool)throw new Error("The node is already deleted. Don't use the objectPool to prevent this error.")
80
+ ;return}
81
+ t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,null!=t.next&&(t.next.prev=t.prev),
82
+ this._root=h(this._root,f(t.child,this._lessThanFunc),this._lessThanFunc)
83
+ }
84
+ t.child=null,t.prev=null,t.next=null,t.item=void 0,null===(e=this._objectPool)||void 0===e||e.release(t),
85
+ this._size--}decreaseKey(t){
86
+ t!==this._root&&(t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,
87
+ null!=t.next&&(t.next.prev=t.prev),
88
+ this._root=h(this._root,t,this._lessThanFunc))}
89
+ get isEmpty(){return null==this._root}
90
+ [Symbol.iterator](){return this._iterate(!1)}
91
+ nodes(){return{
92
+ [Symbol.iterator]:()=>this._iterate(!0)}}
93
+ _iterate(t){const e=this._lessThanFunc
94
+ ;return function*n(r){
95
+ r&&(t?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=f(r.child,e),
96
+ r.child.prev=r),yield*n(r.child)))}(this._root)}}
97
+ function h(t,e,n){let r,s
98
+ ;return null==t?e:null==e||t===e?t:(n(e.item,t.item)?(r=e,
99
+ s=t):(r=t,s=e),s.next=r.child,
100
+ null!=r.child&&(r.child.prev=s),s.prev=r,r.child=s,
101
+ r.next=null,r.prev=null,r)}function f(t,e){
102
+ let n,r,s,i,o;if(null==t)return null
103
+ ;for(i=t,n=null;null!=i;){
104
+ if(r=i,s=r.next,null==s){r.prev=n,n=r;break}
105
+ i=s.next,o=h(r,s,e),o.prev=n,n=o}
106
+ for(o=null;null!=n;)i=n.prev,o=h(o,n,e),n=i
107
+ ;return o}function d(t,e){t(function(t){return{
108
+ then(e,n){n(t)}}}(e))}function _(t){
109
+ return null!=t&&"object"==typeof t&&"function"==typeof t.then
110
+ }let v,b=[];function p(t){
111
+ b.push(t),v||(v=function(){
112
+ return n(this,void 0,void 0,(function*(){
113
+ for(;b.length>0;){yield 0;const t=b
114
+ ;b=[],t.forEach((t=>{try{t()}catch(t){
115
+ console.error("Unhandled promise rejection",t)}}))
116
+ }v=null}))}())}function y(t,e,n){p((()=>{try{
117
+ const r=e?e(t):t;n._resolve(r)}catch(t){
118
+ n._reject(t)}}))}function w(t,e,n){p((()=>{
119
+ if(e)try{const r=e(t);n._resolve(r)}catch(t){
120
+ n._reject(t)}else n._reject(t)}))}
121
+ const g=function(){};class m{constructor(t){
122
+ this.status="pending",this.value=void 0,
123
+ this.reason=void 0,this._handlers=null
124
+ ;const e=this._resolve,n=this._reject,r=this._resolveAsync,s=this._rejectAsync,i=this
125
+ ;this._resolve=function(t){e.call(i,t)
126
+ },this._reject=function(t){n.call(i,t)
127
+ },this._resolveAsync=function(t){r.call(i,t)
128
+ },this._rejectAsync=function(t){s.call(i,t)
129
+ },t(this._resolve,this._reject)}_resolve(t){
130
+ "pending"===this.status&&(this.status="fulfilled",
131
+ this._resolveAsync(t))}_resolveAsync(t){
132
+ _(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
133
+ }_resolveSync(t){const e=this._handlers
134
+ ;if(this.value=t,null!=e){this._handlers=null
135
+ ;for(let n=0,r=e.length;n<r;n++){const[r,,s]=e[n]
136
+ ;y(t,r,s)}}}_reject(t){
137
+ "pending"===this.status&&this._rejectAsync(t)}
138
+ _rejectAsync(t){
139
+ this.status="rejected",_(t)?t.then(this._rejectAsync,this._rejectAsync):this._rejectSync(t)
140
+ }_rejectSync(t){const e=this._handlers
141
+ ;if(this.reason=t,null!=e){this._handlers=null
142
+ ;for(let n=0,r=e.length;n<r;n++){const[,r,s]=e[n]
143
+ ;w(t,r,s)}}}then(t,e){const n=new m(g)
144
+ ;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
145
+ this._handlers.push([t,e,n])):"fulfilled"===this.status?y(this.value,t,n):w(this.reason,e,n),
146
+ n}catch(t){return this.then(void 0,t)}finally(t){
147
+ const e=t&&function(e){const n=t()
148
+ ;return _(n)?n.then((()=>e)):m.resolve(e)
149
+ },n=t&&function(e){const n=t()
150
+ ;return _(n)?n.then((()=>m.reject(e))):m.reject(e)
151
+ };return this.then(e,n)}static resolve(t){
152
+ const e=new m(g);return e._resolve(t),e}
153
+ static reject(t){const e=new m(g)
154
+ ;return e._reject(t),e}get[Symbol.toStringTag](){
155
+ return"Promise"}static get[Symbol.species](){
156
+ return m}static all(t){return function(t,e){
157
+ let n,r;e||(e=Promise);const s=new e(((t,e)=>{
158
+ n=t,r=e}));let i=t.length;const o=[]
159
+ ;return t.forEach(((t,e)=>{_(t)?t.then((t=>{
160
+ o[e]=t,0==--i&&n(o)}),r):(o[e]=t,0==--i&&n(o))
161
+ })),s}(t,m)}static allSettled(t){
162
+ return function(t,e){let n;e||(e=Promise)
163
+ ;const r=new e(((t,e)=>{n=t}));let s=t.length
164
+ ;const i=[];return t.forEach(((t,e)=>{
165
+ _(t)?t.then((t=>{i[e]={status:"fulfilled",value:t
166
+ },0==--s&&n(i)}),(t=>{i[e]={status:"rejected",
167
+ reason:t},0==--s&&n(i)})):(i[e]={
168
+ status:"fulfilled",value:t},0==--s&&n(i))})),r
169
+ }(t,m)}static any(t){return function(t,e){let n,r
170
+ ;e||(e=Promise);const s=new e(((t,e)=>{n=t,r=e}))
171
+ ;let i=t.length;const o=[]
172
+ ;return t.forEach(((t,e)=>{_(t)?t.then(n,(t=>{
173
+ o[e]=t,0==--i&&r(new AggregateError(o))})):n(t)
174
+ })),s}(t,m)}static race(t){return function(t,e){
175
+ let n,r;e||(e=Promise);const s=new e(((t,e)=>{
176
+ n=t,r=e}));return t.forEach((t=>{
177
+ _(t)?t.then(n,r):n(t)})),s}(t,m)}}
178
+ const j=function(){};class x{constructor(t){
179
+ if(this._status="pending",t&&t.aborted)this.promise=m.reject(t.reason),
180
+ this.resolve=j,this.reject=j;else{let e,n
181
+ ;if(this.promise=new Promise((function(t){
182
+ e=t,n=function(e){d(t,e)}})),t){
183
+ const r=t.subscribe((function(t){n(t)}))
184
+ ;this.resolve=function(t){r(),e(t)
185
+ },this.reject=function(t){r(),n(t)}
186
+ }else this.resolve=e,this.reject=n}
187
+ this.promise.then((()=>{this._status="resolved"
188
+ }),(()=>{this._status="rejected"}))}get state(){
189
+ return this._status}}class P{constructor(t,e){
190
+ this._branch=null,this.order=t,this.parent=e}
191
+ get branch(){if(!this._branch){
192
+ const t=[this.order];let e=this.parent
193
+ ;for(;null!=e;)t.push(e.order),e=e.parent
194
+ ;this._branch=t}return this._branch}}
195
+ function S(t,e){return function(t,e){
196
+ const n=t&&t.branch,r=e&&e.branch,s=n?n.length:0,i=r?r.length:0,o=s>i?s:i
197
+ ;for(let t=0;t<o;t++){
198
+ const e=t>=s?0:n[s-1-t],o=t>=i?0:r[i-1-t]
199
+ ;if(e!==o)return e>o?1:-1}return 0
200
+ }(t.priority,e.priority)<0}let k=1;class z{
201
+ constructor(){this._queue=new a({lessThanFunc:S})}
202
+ run(t,e,n){return this._run(!1,t,e,n)}
203
+ runTask(t,e,n){return this._run(!0,t,e,n)}
204
+ _run(t,e,n,r){const s=new x(r),i={
205
+ priority:(o=k++,l=n,null==o?null==l?null:l:new P(o,l)),
206
+ func:e,abortSignal:r,resolve:s.resolve,
207
+ reject:s.reject,readyToRun:!t};var o,l
208
+ ;if(this._queue.add(i),t){const t=this;return{
209
+ result:s.promise,setReadyToRun(e){
210
+ i.readyToRun=e,e&&!t._inProcess&&(t._inProcess=!0,
211
+ t._process())}}}
212
+ return this._inProcess||(this._inProcess=!0,this._process()),s.promise
213
+ }_process(){
214
+ return n(this,void 0,void 0,(function*(){
215
+ const t=this._queue;for(;;){if(yield 0,t.isEmpty){
216
+ this._inProcess=!1;break}let e=t.getMin()
217
+ ;if(e.readyToRun)t.deleteMin();else{let n
218
+ ;for(const e of t.nodes())if(e.item.readyToRun){
219
+ n=e;break}if(!n){this._inProcess=!1;break}
220
+ e=n.item,t.delete(n)}
221
+ if(e.abortSignal&&e.abortSignal.aborted)e.reject(e.abortSignal.reason);else try{
222
+ let t=e.func&&e.func(e.abortSignal)
223
+ ;t&&"function"==typeof t.then&&(t=yield t),e.resolve(t)
224
+ }catch(t){e.reject(t)}}}))}}const E=function(){
225
+ const t=new z;return function(e,n){
226
+ return t.run(void 0,e,n)}}();class T{
227
+ constructor(t){
228
+ if(this._maxSize=0,this._size=0,this._tickPromise=new x,!t)throw new Error("maxSize should be > 0")
229
+ ;this._maxSize=t,
230
+ this._size=t,this._priorityQueue=new z}
231
+ get maxSize(){return this._maxSize}get size(){
232
+ return this._size}get holdAvailable(){
233
+ return this._size}hold(t){const e=this._size
234
+ ;return!(t>e)&&(this._size=e-t,!0)}
235
+ get releaseAvailable(){
236
+ return this.maxSize-this._size}release(t,e){
237
+ const n=this._size,r=this.maxSize-n;if(t>r){
238
+ if(!e)throw new Error(`count (${t} > maxReleaseCount (${r}))`)
239
+ ;t=r}if(t>0&&(this._size=n+t,this._tickPromise)){
240
+ const t=this._tickPromise
241
+ ;this._tickPromise=null,t.resolve()}return t}
242
+ tick(t){
243
+ if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new x),
244
+ function(t,e){return t?new Promise((function(n){
245
+ if(t&&t.aborted)return void d(n,t.reason);let r,s
246
+ ;function i(t){s||(s=!0,r&&r(),d(n,t))}
247
+ e.then((function(t){r&&r(),n(t)
248
+ })).catch(i),t&&(r=t.subscribe(i))})):e
249
+ }(t,this._tickPromise.promise)}holdWait(t,e,r,s){
250
+ if(t>this.maxSize)throw new Error(`holdCount (${t} > maxSize (${this.maxSize}))`)
251
+ ;return s||(s=E),
252
+ this._priorityQueue.run((r=>n(this,void 0,void 0,(function*(){
253
+ for(;t>this._size;)yield this.tick(r),yield s(e,r)
254
+ ;if(!this.hold(t))throw new Error("Unexpected behavior")
255
+ }))),e,r)}}t.createTestVariants=function(t){
256
+ return function(i){return function(o){
257
+ var l=void 0===o?{}:o,u=l.GC_Iterations,a=void 0===u?1e6:u,h=l.GC_IterationsAsync,f=void 0===h?1e4:h,d=l.GC_Interval,_=void 0===d?1e3:d,v=l.logInterval,b=void 0===v?5e3:v,p=l.logCompleted,y=void 0===p||p,w=l.onError,g=void 0===w?null:w,m=l.abortSignal,j=void 0===m?null:m,x=l.parallel,P=new c,S=function(...t){
258
+ let e,n;function r(t){e.abort(t)}
259
+ for(let s=0;s<t.length;s++){const i=t[s];if(i){
260
+ if(i.aborted){r.call(i);break}
261
+ n?(e||(e=new c,n.subscribe(r)),i.subscribe(r)):n=i
262
+ }}return e?e.signal:n||(new c).signal
263
+ }(j,P.signal),k=S,z=Object.keys(i),E=Object.values(i),A=z.length,O={}
264
+ ;function F(t){var e=E[t]
265
+ ;return"function"==typeof e&&(e=e(O)),e}
266
+ for(var I=[],R=[],M=0;M<A;M++)I[M]=-1,R[M]=[]
267
+ ;R[0]=F(0);var C=0,D=0,G=!1,$=0;function q(t,e,s){
46
268
  return n(this,void 0,void 0,(function(){var n
47
- ;return t(this,(function(t){switch(t.label){
269
+ ;return r(this,(function(r){switch(r.label){
48
270
  case 0:
49
- return console.error("error variant: ".concat(T,"\r\n").concat(JSON.stringify(x,null,2))),
50
- console.error(e),
51
- n=Date.now(),Date.now()-n>50&&C<5?(console.log("DEBUG ITERATION: "+C),
52
- j=!0,[4,J()]):[3,2];case 1:t.sent(),C++,t.label=2
53
- ;case 2:throw w&&w({iteration:T,variant:x,error:e
54
- }),e}}))}))}var P=Date.now(),A=P,N=T,B=_
55
- ;function J(){
271
+ return P.abort(t),console.error("error variant: ".concat(e,"\r\n").concat(JSON.stringify(s,null,2))),
272
+ console.error(t),
273
+ n=Date.now(),Date.now()-n>50&&$<5?(console.log("DEBUG ITERATION: "+$),
274
+ G=!0,[4,V()]):[3,2];case 1:r.sent(),$++,r.label=2
275
+ ;case 2:throw g&&g({iteration:e,variant:s,error:t
276
+ }),t}}))}))}
277
+ var N=Date.now(),U=N,W=C,Q=D,B=!0===x?Math.pow(2,31):!x||x<=0?1:x,J=B<=1?null:new T(B)
278
+ ;function K(e,s,i){
279
+ return n(this,void 0,void 0,(function(){var n,o,l
280
+ ;return r(this,(function(r){switch(r.label){
281
+ case 0:return r.trys.push([0,3,,5]),function(t){
282
+ return"object"==typeof t&&t&&"function"==typeof t.then
283
+ }(n=t(s,i))?[4,n]:[3,2];case 1:
284
+ return o=r.sent(),D+=l="number"==typeof o?o:1,C+=l,
285
+ [2];case 2:return C+="number"==typeof n?n:1,[3,5]
286
+ ;case 3:return[4,q(r.sent(),e,s)];case 4:
287
+ return r.sent(),[3,5];case 5:return[2]}}))}))}
288
+ function V(){
56
289
  return n(this,void 0,void 0,(function(){
57
- var n,o,a,i;return t(this,(function(t){
58
- switch(t.label){case 0:
59
- t.trys.push([0,7,,9]),t.label=1;case 1:
60
- return(null==g?void 0:g.aborted)||!j&&!function(){
61
- for(var e=k-1;e>=0;e--){var n=E[e]+1
62
- ;if(n<G[e].length){
63
- for(E[e]=n,x[m[e]]=G[e][n],e++;e<k;e++){var t=D(e)
64
- ;if(0===t.length)break;E[e]=0,G[e]=t,x[m[e]]=t[0]}
65
- if(e>=k)return!0}}return!1
66
- }()?[3,6]:(n=(b||v)&&Date.now(),b&&n-P>=b&&(console.log(T),
67
- P=n),c&&T-N>=c||s&&_-B>=s||v&&n-A>=v?(N=T,
68
- B=_,A=n,[4,r(1)]):[3,3]);case 2:
69
- return t.sent(),[3,1];case 3:
70
- return"object"==typeof(o=e(x))&&o&&"function"==typeof o.then?[4,o]:[3,5]
71
- ;case 4:
72
- return a=t.sent(),_+=i="number"==typeof a?a:1,T+=i,[3,1]
73
- ;case 5:return T+="number"==typeof o?o:1,[3,1]
74
- ;case 6:return[3,9];case 7:return[4,S(t.sent())]
75
- ;case 8:return t.sent(),[3,9];case 9:
76
- if(null==g?void 0:g.aborted)throw g.reason
77
- ;return p&&console.log("variants: "+T),[4,r(1)]
78
- ;case 10:return t.sent(),[2,T]}}))}))}return J()}}
79
- },Object.defineProperty(e,"__esModule",{value:!0})
290
+ var t,i=this;return r(this,(function(o){
291
+ switch(o.label){case 0:t=function(){var t,o,l
292
+ ;return r(this,(function(c){switch(c.label){
293
+ case 0:
294
+ return t=C,o=J?e({},O):O,l=(b||_)&&Date.now(),b&&l-N>=b&&(console.log(C),
295
+ N=l),a&&C-W>=a||f&&D-Q>=f||_&&l-U>=_?(W=C,
296
+ Q=D,U=l,[4,s(1)]):[3,2];case 1:
297
+ return c.sent(),[2,"continue"];case 2:
298
+ return(null==j?void 0:j.aborted)?[2,"continue"]:J&&!S.aborted?[3,4]:[4,K(t,o,j)]
299
+ ;case 3:return c.sent(),[3,7];case 4:
300
+ return J.hold(1)?[3,6]:[4,J.holdWait(1)];case 5:
301
+ c.sent(),c.label=6;case 6:
302
+ n(i,void 0,void 0,(function(){
303
+ return r(this,(function(e){switch(e.label){case 0:
304
+ return e.trys.push([0,,2,3]),(null==S?void 0:S.aborted)?[2]:[4,K(t,o,S)]
305
+ ;case 1:return e.sent(),[3,3];case 2:
306
+ return J.release(1),[7];case 3:return[2]}}))
307
+ })),c.label=7;case 7:return[2]}}))},o.label=1
308
+ ;case 1:
309
+ return(null==j?void 0:j.aborted)||!G&&!function(){
310
+ for(var t=A-1;t>=0;t--){var e=I[t]+1
311
+ ;if(e<R[t].length){
312
+ for(I[t]=e,O[z[t]]=R[t][e],t++;t<A;t++){var n=F(t)
313
+ ;if(0===n.length)break;I[t]=0,R[t]=n,O[z[t]]=n[0]}
314
+ if(t>=A)return!0}}return!1}()?[3,3]:[5,t()]
315
+ ;case 2:return o.sent(),[3,1];case 3:
316
+ return J?[4,J.holdWait(B)]:[3,5];case 4:
317
+ o.sent(),J.release(B),o.label=5;case 5:
318
+ if(null==k?void 0:k.aborted)throw k.reason
319
+ ;return y&&console.log("variants: "+C),[4,s(1)]
320
+ ;case 6:return o.sent(),[2,C]}}))}))}return V()}}
321
+ },Object.defineProperty(t,"__esModule",{value:!0})
80
322
  }({});
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var testVariants_createTestVariants = require('./test-variants/createTestVariants.cjs');
6
6
  require('tslib');
7
7
  require('./garbage-collect/garbageCollect.cjs');
8
+ require('@flemist/abort-controller-fast');
9
+ require('@flemist/time-limits');
10
+ require('@flemist/async-utils');
8
11
 
9
12
 
10
13
 
@@ -1,3 +1,6 @@
1
1
  export { createTestVariants } from './test-variants/createTestVariants.mjs';
2
2
  import 'tslib';
3
3
  import './garbage-collect/garbageCollect.mjs';
4
+ import '@flemist/abort-controller-fast';
5
+ import '@flemist/time-limits';
6
+ import '@flemist/async-utils';
@@ -4,11 +4,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
6
  var garbageCollect_garbageCollect = require('../garbage-collect/garbageCollect.cjs');
7
+ var abortControllerFast = require('@flemist/abort-controller-fast');
8
+ var timeLimits = require('@flemist/time-limits');
9
+ var asyncUtils = require('@flemist/async-utils');
7
10
 
8
11
  /* eslint-disable @typescript-eslint/no-shadow */
12
+ function isPromiseLike(value) {
13
+ return typeof value === 'object'
14
+ && value
15
+ && typeof value.then === 'function';
16
+ }
9
17
  function createTestVariants(test) {
10
18
  return function testVariantsArgs(args) {
11
- return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, onError: onErrorCallback = null, abortSignal, } = {}) {
19
+ return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, onError: onErrorCallback = null, abortSignal: abortSignalExternal = null, parallel: _parallel, } = {}) {
20
+ const abortControllerParallel = new abortControllerFast.AbortControllerFast();
21
+ const abortSignalParallel = asyncUtils.combineAbortSignals(abortSignalExternal, abortControllerParallel.signal);
22
+ const abortSignalAll = abortSignalParallel;
12
23
  const argsKeys = Object.keys(args);
13
24
  const argsValues = Object.values(args);
14
25
  const argsLength = argsKeys.length;
@@ -53,8 +64,9 @@ function createTestVariants(test) {
53
64
  let iterationsAsync = 0;
54
65
  let debug = false;
55
66
  let debugIteration = 0;
56
- function onError(error) {
67
+ function onError(error, iterations, variantArgs) {
57
68
  return tslib.__awaiter(this, void 0, void 0, function* () {
69
+ abortControllerParallel.abort(error);
58
70
  console.error(`error variant: ${iterations}\r\n${JSON.stringify(variantArgs, null, 2)}`);
59
71
  console.error(error);
60
72
  // rerun failed variant 5 times for debug
@@ -86,43 +98,83 @@ function createTestVariants(test) {
86
98
  let prevGC_Time = prevLogTime;
87
99
  let prevGC_Iterations = iterations;
88
100
  let prevGC_IterationsAsync = iterationsAsync;
89
- function next() {
101
+ const parallel = _parallel === true
102
+ ? Math.pow(2, 31)
103
+ : !_parallel || _parallel <= 0
104
+ ? 1
105
+ : _parallel;
106
+ const pool = parallel <= 1
107
+ ? null
108
+ : new timeLimits.Pool(parallel);
109
+ function runTest(_iterations, variantArgs, abortSignal) {
90
110
  return tslib.__awaiter(this, void 0, void 0, function* () {
91
111
  try {
92
- while (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) && (debug || nextVariant())) {
93
- const now = (logInterval || GC_Interval) && Date.now();
94
- if (logInterval && now - prevLogTime >= logInterval) {
95
- // the log is required to prevent the karma browserNoActivityTimeout
96
- console.log(iterations);
97
- prevLogTime = now;
98
- }
99
- if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
100
- || GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
101
- || GC_Interval && now - prevGC_Time >= GC_Interval) {
102
- prevGC_Iterations = iterations;
103
- prevGC_IterationsAsync = iterationsAsync;
104
- prevGC_Time = now;
105
- yield garbageCollect_garbageCollect.garbageCollect(1);
106
- continue;
107
- }
108
- const promiseOrIterations = test(variantArgs);
109
- if (typeof promiseOrIterations === 'object'
110
- && promiseOrIterations
111
- && typeof promiseOrIterations.then === 'function') {
112
- const value = yield promiseOrIterations;
113
- const newIterations = typeof value === 'number' ? value : 1;
114
- iterationsAsync += newIterations;
115
- iterations += newIterations;
116
- continue;
117
- }
118
- iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
112
+ const promiseOrIterations = test(variantArgs, abortSignal);
113
+ if (isPromiseLike(promiseOrIterations)) {
114
+ const value = yield promiseOrIterations;
115
+ const newIterations = typeof value === 'number' ? value : 1;
116
+ iterationsAsync += newIterations;
117
+ iterations += newIterations;
118
+ return;
119
119
  }
120
+ iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
120
121
  }
121
122
  catch (err) {
122
- yield onError(err);
123
+ yield onError(err, _iterations, variantArgs);
124
+ }
125
+ });
126
+ }
127
+ function next() {
128
+ return tslib.__awaiter(this, void 0, void 0, function* () {
129
+ while (!(abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) && (debug || nextVariant())) {
130
+ const _iterations = iterations;
131
+ const _variantArgs = !pool
132
+ ? variantArgs
133
+ : Object.assign({}, variantArgs);
134
+ const now = (logInterval || GC_Interval) && Date.now();
135
+ if (logInterval && now - prevLogTime >= logInterval) {
136
+ // the log is required to prevent the karma browserNoActivityTimeout
137
+ console.log(iterations);
138
+ prevLogTime = now;
139
+ }
140
+ if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
141
+ || GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
142
+ || GC_Interval && now - prevGC_Time >= GC_Interval) {
143
+ prevGC_Iterations = iterations;
144
+ prevGC_IterationsAsync = iterationsAsync;
145
+ prevGC_Time = now;
146
+ yield garbageCollect_garbageCollect.garbageCollect(1);
147
+ continue;
148
+ }
149
+ if (abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) {
150
+ continue;
151
+ }
152
+ if (!pool || abortSignalParallel.aborted) {
153
+ yield runTest(_iterations, _variantArgs, abortSignalExternal);
154
+ }
155
+ else {
156
+ if (!pool.hold(1)) {
157
+ yield pool.holdWait(1);
158
+ }
159
+ void (() => tslib.__awaiter(this, void 0, void 0, function* () {
160
+ try {
161
+ if (abortSignalParallel === null || abortSignalParallel === void 0 ? void 0 : abortSignalParallel.aborted) {
162
+ return;
163
+ }
164
+ yield runTest(_iterations, _variantArgs, abortSignalParallel);
165
+ }
166
+ finally {
167
+ void pool.release(1);
168
+ }
169
+ }))();
170
+ }
171
+ }
172
+ if (pool) {
173
+ yield pool.holdWait(parallel);
174
+ void pool.release(parallel);
123
175
  }
124
- if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {
125
- throw abortSignal.reason;
176
+ if (abortSignalAll === null || abortSignalAll === void 0 ? void 0 : abortSignalAll.aborted) {
177
+ throw abortSignalAll.reason;
126
178
  }
127
179
  onCompleted();
128
180
  yield garbageCollect_garbageCollect.garbageCollect(1);
@@ -24,7 +24,7 @@ export declare type TestVariantsCallParams<TArgs> = {
24
24
  error: any;
25
25
  }) => void;
26
26
  abortSignal?: IAbortSignalFast;
27
- parallel?: number;
27
+ parallel?: null | number | boolean;
28
28
  };
29
- export declare function createTestVariants<TArgs extends object>(test: (args: TArgs) => Promise<number | void> | number | void): TestVariantsSetArgs<TArgs>;
29
+ export declare function createTestVariants<TArgs extends object>(test: (args: TArgs, abortSignal: IAbortSignalFast) => Promise<number | void> | number | void): TestVariantsSetArgs<TArgs>;
30
30
  export {};
@@ -1,10 +1,21 @@
1
1
  import { __awaiter } from 'tslib';
2
2
  import { garbageCollect } from '../garbage-collect/garbageCollect.mjs';
3
+ import { AbortControllerFast } from '@flemist/abort-controller-fast';
4
+ import { Pool } from '@flemist/time-limits';
5
+ import { combineAbortSignals } from '@flemist/async-utils';
3
6
 
4
7
  /* eslint-disable @typescript-eslint/no-shadow */
8
+ function isPromiseLike(value) {
9
+ return typeof value === 'object'
10
+ && value
11
+ && typeof value.then === 'function';
12
+ }
5
13
  function createTestVariants(test) {
6
14
  return function testVariantsArgs(args) {
7
- return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, onError: onErrorCallback = null, abortSignal, } = {}) {
15
+ return function testVariantsCall({ GC_Iterations = 1000000, GC_IterationsAsync = 10000, GC_Interval = 1000, logInterval = 5000, logCompleted = true, onError: onErrorCallback = null, abortSignal: abortSignalExternal = null, parallel: _parallel, } = {}) {
16
+ const abortControllerParallel = new AbortControllerFast();
17
+ const abortSignalParallel = combineAbortSignals(abortSignalExternal, abortControllerParallel.signal);
18
+ const abortSignalAll = abortSignalParallel;
8
19
  const argsKeys = Object.keys(args);
9
20
  const argsValues = Object.values(args);
10
21
  const argsLength = argsKeys.length;
@@ -49,8 +60,9 @@ function createTestVariants(test) {
49
60
  let iterationsAsync = 0;
50
61
  let debug = false;
51
62
  let debugIteration = 0;
52
- function onError(error) {
63
+ function onError(error, iterations, variantArgs) {
53
64
  return __awaiter(this, void 0, void 0, function* () {
65
+ abortControllerParallel.abort(error);
54
66
  console.error(`error variant: ${iterations}\r\n${JSON.stringify(variantArgs, null, 2)}`);
55
67
  console.error(error);
56
68
  // rerun failed variant 5 times for debug
@@ -82,43 +94,83 @@ function createTestVariants(test) {
82
94
  let prevGC_Time = prevLogTime;
83
95
  let prevGC_Iterations = iterations;
84
96
  let prevGC_IterationsAsync = iterationsAsync;
85
- function next() {
97
+ const parallel = _parallel === true
98
+ ? Math.pow(2, 31)
99
+ : !_parallel || _parallel <= 0
100
+ ? 1
101
+ : _parallel;
102
+ const pool = parallel <= 1
103
+ ? null
104
+ : new Pool(parallel);
105
+ function runTest(_iterations, variantArgs, abortSignal) {
86
106
  return __awaiter(this, void 0, void 0, function* () {
87
107
  try {
88
- while (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) && (debug || nextVariant())) {
89
- const now = (logInterval || GC_Interval) && Date.now();
90
- if (logInterval && now - prevLogTime >= logInterval) {
91
- // the log is required to prevent the karma browserNoActivityTimeout
92
- console.log(iterations);
93
- prevLogTime = now;
94
- }
95
- if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
96
- || GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
97
- || GC_Interval && now - prevGC_Time >= GC_Interval) {
98
- prevGC_Iterations = iterations;
99
- prevGC_IterationsAsync = iterationsAsync;
100
- prevGC_Time = now;
101
- yield garbageCollect(1);
102
- continue;
103
- }
104
- const promiseOrIterations = test(variantArgs);
105
- if (typeof promiseOrIterations === 'object'
106
- && promiseOrIterations
107
- && typeof promiseOrIterations.then === 'function') {
108
- const value = yield promiseOrIterations;
109
- const newIterations = typeof value === 'number' ? value : 1;
110
- iterationsAsync += newIterations;
111
- iterations += newIterations;
112
- continue;
113
- }
114
- iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
108
+ const promiseOrIterations = test(variantArgs, abortSignal);
109
+ if (isPromiseLike(promiseOrIterations)) {
110
+ const value = yield promiseOrIterations;
111
+ const newIterations = typeof value === 'number' ? value : 1;
112
+ iterationsAsync += newIterations;
113
+ iterations += newIterations;
114
+ return;
115
115
  }
116
+ iterations += typeof promiseOrIterations === 'number' ? promiseOrIterations : 1;
116
117
  }
117
118
  catch (err) {
118
- yield onError(err);
119
+ yield onError(err, _iterations, variantArgs);
120
+ }
121
+ });
122
+ }
123
+ function next() {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ while (!(abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) && (debug || nextVariant())) {
126
+ const _iterations = iterations;
127
+ const _variantArgs = !pool
128
+ ? variantArgs
129
+ : Object.assign({}, variantArgs);
130
+ const now = (logInterval || GC_Interval) && Date.now();
131
+ if (logInterval && now - prevLogTime >= logInterval) {
132
+ // the log is required to prevent the karma browserNoActivityTimeout
133
+ console.log(iterations);
134
+ prevLogTime = now;
135
+ }
136
+ if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
137
+ || GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
138
+ || GC_Interval && now - prevGC_Time >= GC_Interval) {
139
+ prevGC_Iterations = iterations;
140
+ prevGC_IterationsAsync = iterationsAsync;
141
+ prevGC_Time = now;
142
+ yield garbageCollect(1);
143
+ continue;
144
+ }
145
+ if (abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) {
146
+ continue;
147
+ }
148
+ if (!pool || abortSignalParallel.aborted) {
149
+ yield runTest(_iterations, _variantArgs, abortSignalExternal);
150
+ }
151
+ else {
152
+ if (!pool.hold(1)) {
153
+ yield pool.holdWait(1);
154
+ }
155
+ void (() => __awaiter(this, void 0, void 0, function* () {
156
+ try {
157
+ if (abortSignalParallel === null || abortSignalParallel === void 0 ? void 0 : abortSignalParallel.aborted) {
158
+ return;
159
+ }
160
+ yield runTest(_iterations, _variantArgs, abortSignalParallel);
161
+ }
162
+ finally {
163
+ void pool.release(1);
164
+ }
165
+ }))();
166
+ }
167
+ }
168
+ if (pool) {
169
+ yield pool.holdWait(parallel);
170
+ void pool.release(parallel);
119
171
  }
120
- if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {
121
- throw abortSignal.reason;
172
+ if (abortSignalAll === null || abortSignalAll === void 0 ? void 0 : abortSignalAll.aborted) {
173
+ throw abortSignalAll.reason;
122
174
  }
123
175
  onCompleted();
124
176
  yield garbageCollect(1);
@@ -4,6 +4,9 @@ var rdtsc = require('rdtsc');
4
4
  var testVariants_createTestVariants = require('./createTestVariants.cjs');
5
5
  require('tslib');
6
6
  require('../garbage-collect/garbageCollect.cjs');
7
+ require('@flemist/abort-controller-fast');
8
+ require('@flemist/time-limits');
9
+ require('@flemist/async-utils');
7
10
 
8
11
  describe('test > testVariants perf', function () {
9
12
  this.timeout(300000);
@@ -2,6 +2,9 @@ import { calcPerformance } from 'rdtsc';
2
2
  import { createTestVariants } from './createTestVariants.mjs';
3
3
  import 'tslib';
4
4
  import '../garbage-collect/garbageCollect.mjs';
5
+ import '@flemist/abort-controller-fast';
6
+ import '@flemist/time-limits';
7
+ import '@flemist/async-utils';
5
8
 
6
9
  describe('test > testVariants perf', function () {
7
10
  this.timeout(300000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flemist/test-variants",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Runs a test function with all possible combinations of its parameters.",
5
5
  "main": "dist/lib/index.cjs",
6
6
  "module": "dist/lib/index.mjs",
@@ -32,23 +32,6 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "scripts": {
36
- "_prepublishOnly": "pnpm run audit && pnpm run lint && pnpm run build && pnpm run test:mocha:ci && pnpm run test:karma",
37
- "audit": "pnpm audit --prod",
38
- "lint": "eslint ./**/*.{js,cjs,mjs,ts,tsx}",
39
- "lint:fix": "eslint --fix ./**/*.{js,cjs,mjs,ts,tsx}",
40
- "lint:wizard": "eslint-nibble --cache --multi ./**/*.{js,cjs,mjs,ts,tsx}",
41
- "build:js": "rimraf dist/lib && cpy \"**/assets/**\" \"**/*.{js,cjs,mjs}\" \"../dist/lib/\" --parents --cwd=src && rollup -c",
42
- "build": "rimraf dist && pnpm run build:js",
43
- "coverage:merge": "rimraf tmp/coverage/{all,merge} && cp-flat \"tmp/coverage/*/json/**/*.json\" \"tmp/coverage/merge\" && nyc report -r lcov --report-dir tmp/coverage/all/lcov --temp-dir \"tmp/coverage/merge/\"",
44
- "coverage:check": "pnpm run coverage:merge && nyc check-coverage --report-dir tmp/coverage/all/lcov --lines 50 --functions 50 --branches 50 --statements 50",
45
- "test:mocha": "mocha ./src/**/*.test.*",
46
- "test:mocha:coverage": "rimraf tmp/coverage/mocha && nyc --all mocha ./src/**/*.test.*",
47
- "test:mocha:watch": "mocha --watch ./src/**/*.test.*",
48
- "test:karma": "rimraf tmp/coverage/karma && karma start --single-run --log-level debug",
49
- "test:mocha:ci": "rimraf tmp/coverage/mocha && nyc --all mocha ./{src,dist/lib}/**/*.test.*",
50
- "coveralls": "pnpm run coverage:check && nyc report --reporter=text-lcov --temp-dir \"tmp/coverage/merge/\" | coveralls"
51
- },
52
35
  "devDependencies": {
53
36
  "@babel/core": "7.18.5",
54
37
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
@@ -58,7 +41,7 @@
58
41
  "@babel/runtime-corejs3": "7.18.3",
59
42
  "@flemist/copy-glob-flat": "0.0.5",
60
43
  "@flemist/karma-custom-launcher": "0.0.0",
61
- "@flemist/test-utils": "0.0.9",
44
+ "@flemist/test-utils": "1.0.2",
62
45
  "@rollup/plugin-alias": "3.1.9",
63
46
  "@rollup/plugin-babel": "5.3.1",
64
47
  "@rollup/plugin-commonjs": "=21.1.0",
@@ -75,7 +58,7 @@
75
58
  "@zerollup/ts-transform-paths": "1.7.18",
76
59
  "cpy-cli": "=3.1.1",
77
60
  "eslint": "8.18.0",
78
- "eslint-config-pro": "3.0.16",
61
+ "eslint-config-pro": "3.0.19",
79
62
  "globby": "=11.1.0",
80
63
  "karma": "6.4.0",
81
64
  "karma-chrome-launcher": "3.1.1",
@@ -85,7 +68,7 @@
85
68
  "karma-safari-launcher": "1.0.0",
86
69
  "mocha": "9.2.2",
87
70
  "nyc": "15.1.0",
88
- "rdtsc": "3.0.3",
71
+ "rdtsc": "3.0.4",
89
72
  "rimraf": "3.0.2",
90
73
  "rollup": "2.75.7",
91
74
  "rollup-plugin-delete": "2.0.0",
@@ -98,7 +81,25 @@
98
81
  "typescript": "=4.7.4"
99
82
  },
100
83
  "dependencies": {
101
- "@flemist/abort-controller-fast": "1.0.0",
84
+ "@flemist/abort-controller-fast": "^1.0.0",
85
+ "@flemist/async-utils": "^1.0.0",
86
+ "@flemist/time-limits": "^1.0.1",
102
87
  "tslib": "^2.4.0"
88
+ },
89
+ "scripts": {
90
+ "audit": "pnpm audit --prod",
91
+ "lint": "eslint ./**/*.{js,cjs,mjs,ts,tsx}",
92
+ "lint:fix": "eslint --fix ./**/*.{js,cjs,mjs,ts,tsx}",
93
+ "lint:wizard": "eslint-nibble --cache --multi ./**/*.{js,cjs,mjs,ts,tsx}",
94
+ "build:js": "rimraf dist/lib && cpy \"**/assets/**\" \"**/*.{js,cjs,mjs}\" \"../dist/lib/\" --parents --cwd=src && rollup -c",
95
+ "build": "rimraf dist && pnpm run build:js",
96
+ "coverage:merge": "rimraf tmp/coverage/{all,merge} && cp-flat \"tmp/coverage/*/json/**/*.json\" \"tmp/coverage/merge\" && nyc report -r lcov --report-dir tmp/coverage/all/lcov --temp-dir \"tmp/coverage/merge/\"",
97
+ "coverage:check": "pnpm run coverage:merge && nyc check-coverage --report-dir tmp/coverage/all/lcov --lines 50 --functions 50 --branches 50 --statements 50",
98
+ "test:mocha": "mocha ./src/**/*.test.*",
99
+ "test:mocha:coverage": "rimraf tmp/coverage/mocha && nyc --all mocha ./src/**/*.test.*",
100
+ "test:mocha:watch": "mocha --watch ./src/**/*.test.*",
101
+ "test:karma": "rimraf tmp/coverage/karma && karma start --single-run --log-level debug",
102
+ "test:mocha:ci": "rimraf tmp/coverage/mocha && nyc --all mocha ./{src,dist/lib}/**/*.test.*",
103
+ "coveralls": "pnpm run coverage:check && nyc report --reporter=text-lcov --temp-dir \"tmp/coverage/merge/\" | coveralls"
103
104
  }
104
- }
105
+ }