aotrautils-srv 0.0.528 → 0.0.530

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,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:41)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/07/2023-22:19:13)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -456,40 +456,50 @@ window.aotestMethods.getScenariiInTest=function(test){
456
456
  return results;
457
457
  };
458
458
 
459
- window.aotestMethods.iterateInScenarii=function(allTests, doOnIteration, testsType=null, filter=null){
459
+
460
+
461
+ /*private*/window.aotestMethods.doForAllTestsByType=function(allTestsByType){
460
462
 
461
- if(testsType){
463
+ const loopResultI=foreach(allTestsByType,(testsByFunction,functionName)=>{
464
+ const loopResultJ=foreach(testsByFunction,(test,executionCoupleName)=>{
465
+
466
+ const scenarii=aotestMethods.getScenariiInTest(test)
467
+ const loopResultK=foreach(scenarii,(scenario, scenarioName)=>{
462
468
 
463
- foreach(allTests[testsType],(testsByFunction,functionName)=>{
464
- foreach(testsByFunction,(test,executionCoupleName)=>{
465
-
466
- const scenarii=aotestMethods.getScenariiInTest(test)
467
- foreach(scenarii,(scenario, scenarioName)=>{
468
-
469
- doOnIteration(scenario);
470
-
471
- },(scenario, scenarioName)=>filter && filter(scenario));
472
- });
473
- });
474
- }else{
469
+ if(doOnIteration) doOnIteration(scenario);
470
+ if(mustTerminate && mustTerminate(scenario))
471
+ return scenario;
472
+
473
+ },(scenario, scenarioName)=>filter && filter(scenario));
474
+
475
+ if(loopResultK)
476
+ return loopResultK;
477
+
478
+ });
479
+
480
+ if(loopResultJ)
481
+ return loopResultJ;
475
482
 
476
- foreach(allTests,(allTestsByType,t)=>{
483
+ });
484
+
485
+ return loopResultI;
486
+ }
477
487
 
478
- foreach(allTestsByType,(testsByFunction,functionName)=>{
479
- foreach(testsByFunction,(test,executionCoupleName)=>{
488
+ /*public*/window.aotestMethods.iterateOverScenarii=function(allTests, doOnIteration, testsType=null, filter=null, mustTerminate=null){
489
+
490
+ if(testsType){
480
491
 
481
- const scenarii=aotestMethods.getScenariiInTest(test)
482
- foreach(scenarii,(scenario, scenarioName)=>{
483
-
484
- doOnIteration(scenario);
485
-
486
- },(scenario, scenarioName)=>filter && filter(scenario));
487
- });
488
- });
489
-
492
+ const allTestsByType=allTests[testsType];
493
+ return doForAllTestsByType(allTestsByType);
494
+
495
+ }else{
496
+
497
+ return foreach(allTests,(allTestsByType,t)=>{
498
+ const loopResultH=doForAllTestsByType(allTestsByType);
499
+ if(loopResultH)
500
+ return loopResultH;
490
501
  });
491
502
 
492
-
493
503
  }
494
504
 
495
505
  };
@@ -4919,7 +4929,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4919
4929
 
4920
4930
 
4921
4931
 
4922
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:41)»*/
4932
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/07/2023-22:19:13)»*/
4923
4933
  /*-----------------------------------------------------------------------------*/
4924
4934
 
4925
4935
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.528",
3
+ "version": "0.0.530",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",