aotrautils 0.0.530 → 0.0.532

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 (04/07/2023-23:18:39)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:37)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -448,7 +448,7 @@ if(!window.aotestAllTestsManager){
448
448
  };
449
449
 
450
450
  // Utility methods for aotest framework :
451
- window.aotestMethods.getScenariosInTest=function(test){
451
+ window.aotestMethods.getScenariiInTest=function(test){
452
452
  let results={};
453
453
  foreach(test,(s,sKey)=>{
454
454
  results[sKey]=s;
@@ -456,6 +456,51 @@ window.aotestMethods.getScenariosInTest=function(test){
456
456
  return results;
457
457
  };
458
458
 
459
+ window.aotestMethods.iterateInScenarii=function(allTests, doOnIteration, testsType=null, filter=null){
460
+
461
+ if(testsType){
462
+
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{
475
+
476
+ foreach(allTests,(allTestsByType,t)=>{
477
+
478
+ foreach(allTestsByType,(testsByFunction,functionName)=>{
479
+ foreach(testsByFunction,(test,executionCoupleName)=>{
480
+
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
+
490
+ });
491
+
492
+
493
+ }
494
+
495
+ };
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
459
504
  window.aotestMethods.isScenarioName=function(scenarioName){
460
505
  return contains(scenarioName,"_scenario");
461
506
  };
@@ -1191,7 +1236,7 @@ aotest.run=function(testName=null,scenarioName=null){
1191
1236
  // // DBG
1192
1237
  // console.log("chosenTestParam",chosenTestParam);
1193
1238
 
1194
- foreach(aotestMethods.getScenariosInTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1239
+ foreach(aotestMethods.getScenariiInTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1195
1240
 
1196
1241
  // DBG
1197
1242
  console.log("WE RUN ONE SCENARIO !!!");
@@ -4874,7 +4919,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4874
4919
 
4875
4920
 
4876
4921
 
4877
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (04/07/2023-23:18:39)»*/
4922
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:37)»*/
4878
4923
  /*-----------------------------------------------------------------------------*/
4879
4924
  /* ## Utility global methods in a browser (htmljs) client environment.
4880
4925
  *
@@ -13141,7 +13186,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13141
13186
 
13142
13187
 
13143
13188
 
13144
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/07/2023-23:18:39)»*/
13189
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:37)»*/
13145
13190
  /*-----------------------------------------------------------------------------*/
13146
13191
 
13147
13192
 
@@ -14380,7 +14425,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14380
14425
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14381
14426
 
14382
14427
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14383
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/07/2023-23:18:39)»*/
14428
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/07/2023-12:08:37)»*/
14384
14429
  /*-----------------------------------------------------------------------------*/
14385
14430
 
14386
14431
 
@@ -14483,15 +14528,15 @@ if(typeof(fs)==="undefined"){
14483
14528
 
14484
14529
 
14485
14530
  let resultData={};
14531
+
14532
+ // 1)
14486
14533
  if(!empty(resultFlat)) resultData=JSON.parse(resultFlat);
14487
-
14488
14534
 
14535
+ // 2)
14489
14536
  if(!empty(resultData) && isFlatMap(resultData)){
14490
-
14491
14537
  resultData=getAsTreeStructure(resultData,true
14492
- // We have to keep the type information, here too ! (in the sub-objects)
14493
- ,false);
14494
-
14538
+ // We have to keep the type information, here too ! (in the sub-objects)
14539
+ ,false);
14495
14540
  }
14496
14541
 
14497
14542
  return resultData;
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.530",
3
+ "version": "0.0.532",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",