aotrautils-srv 0.0.2039 → 0.0.2040

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 (17/10/2026-02:53:54)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (18/10/2026-01:58:26)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -457,6 +457,30 @@ if(!window.aotestAllTestsManager){
457
457
  // Utility methods for aotest framework :
458
458
 
459
459
  // UI/CLI ONLY :
460
+
461
+ window.aotestMethods.getTestsMapForScenarii=(testsArray, scenariiNames=null/*(OPTIONAL)*/)=>{
462
+ const testsMap={};
463
+
464
+ if(!scenariiNames || scenariiNames=="" || scenariiNames=="*"){// Case we want all tests from all scenarii:
465
+ foreach(testsArray, (test, testName)=>{
466
+ // (to avoid doing this treatment several times unecessarily)
467
+ if(testsMap[testName]) return "continue";
468
+ testsMap[testName]=test;
469
+ });
470
+ }else{
471
+ foreach(scenariiNames,scenarioName=>{
472
+ foreach(testsArray,(test,testName)=>{
473
+ // (to avoid doing this treatment several times unecessarily)
474
+ if(testsMap[testName]) return "continue";
475
+ testsMap[testName]=test;
476
+ },(test, testName)=>(contains(Object.keys(test),scenarioName)));
477
+ });
478
+ }
479
+
480
+ return testsMap;
481
+ };
482
+
483
+
460
484
  window.aotestMethods.getParentTestByScenarioNameInTestsArray=function(testsArray, scenarioName){
461
485
  return foreach(testsArray,test=>{
462
486
  return window.aotestMethods.iterateOverScenariiInSingleTest(test, (parentTest, scenario)=>{
@@ -560,7 +584,7 @@ window.aotestMethods.getScenarioInSingleTest=function(test, scenarioName=null){
560
584
  window.aotestMethods.getScenariiInSingleTest=function(test, scenariiNames=null){
561
585
  let results={};
562
586
  window.aotestMethods.iterateOverScenariiInSingleTest(test,(t,s,sName)=>{
563
- if(!scenariiNames || contains(scenariiNames, sName)){
587
+ if(!scenariiNames || scenariiNames=="" || scenariiNames=="*" || contains(scenariiNames, sName)){
564
588
  results[sName]=s;
565
589
  }
566
590
  });
@@ -578,6 +602,7 @@ window.aotestMethods.iterateOverScenariiInSingleTest=function(test, doOnEachIter
578
602
 
579
603
 
580
604
 
605
+
581
606
  /*public*/window.aotestMethods.iterateOverValuesOnClonedObject=function(scenarioParam, doOnIterationForValue, visited=[], valuePath="", isValueFunction=null){
582
607
 
583
608
  // CAUTION : We ABSOLUTELY need to iterate over a deep copy, or else it will create weird incomprehensible bugs
@@ -5485,7 +5510,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5485
5510
 
5486
5511
 
5487
5512
 
5488
- /*utils AI library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:54)»*/
5513
+ /*utils AI library associated with aotra version : «1_29072022-2359 (18/10/2026-01:58:26)»*/
5489
5514
  /*-----------------------------------------------------------------------------*/
5490
5515
 
5491
5516
 
@@ -5749,7 +5774,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
5749
5774
 
5750
5775
 
5751
5776
 
5752
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:54)»*/
5777
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (18/10/2026-01:58:26)»*/
5753
5778
  /*-----------------------------------------------------------------------------*/
5754
5779
 
5755
5780
 
@@ -9296,9 +9321,9 @@ window.isURLLocalhost=(url)=>{
9296
9321
 
9297
9322
 
9298
9323
  window.assert={};
9299
- window.assert.notNull=(value, errorMessage=null)=>{
9324
+ window.assert.notNull=(value, variableName=null, errorMessage=null)=>{
9300
9325
  if(typeof(value)=="undefined" || value==null)
9301
- throw new Error(nonull(errorMessage, "ERROR : Value is null."));
9326
+ throw new Error(nonull(errorMessage, (variableName?"ERROR : "+variableName+" is null.":"ERROR : Value is null.")));
9302
9327
  };
9303
9328
 
9304
9329
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.2039",
3
+ "version": "0.0.2040",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils-srv",
9
- "version": "0.0.2039",
9
+ "version": "0.0.2040",
10
10
  "license": "HGPL-1.0",
11
11
  "dependencies": {
12
12
  "atob": "^2.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.2039",
3
+ "version": "0.0.2040",
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)",