aotrautils-srv 0.0.1919 → 0.0.1922
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 (26/07/2026-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2026-14:28:34)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -831,7 +831,7 @@ window.aotest=function(parameters,functionDefinition=null,ignoreTest=false,CLASS
|
|
|
831
831
|
// It is because you can see asserts as obstacles to your test success :
|
|
832
832
|
// So if there is no obstacle to its success, then there is will be no reason
|
|
833
833
|
// for it not to succeed !
|
|
834
|
-
aotest.assert=function(booleanCondition, behavior){
|
|
834
|
+
window.aotest.assert=function(booleanCondition, behavior){
|
|
835
835
|
if(!window.aotestAllTestsManager.activateAsserts)
|
|
836
836
|
return;
|
|
837
837
|
if(booleanCondition && behavior === "fail")
|
|
@@ -863,7 +863,7 @@ aotest.assert=function(booleanCondition, behavior){
|
|
|
863
863
|
*
|
|
864
864
|
* */
|
|
865
865
|
|
|
866
|
-
aotest.run=function(testName=null,scenarioName=null){
|
|
866
|
+
window.aotest.run=function(testName=null,scenarioName=null){
|
|
867
867
|
// CONSTANTS :
|
|
868
868
|
var FAIL_IF_CHILDREN_FAILED=true;
|
|
869
869
|
|
|
@@ -896,7 +896,7 @@ aotest.run=function(testName=null,scenarioName=null){
|
|
|
896
896
|
return testsResultsObj;
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
aotest.isRunning=true;
|
|
899
|
+
window.aotest.isRunning=true;
|
|
900
900
|
|
|
901
901
|
// Function 1, case run one test>one scenario
|
|
902
902
|
const runOneTestOneScenario=function(chosenTestParam, chosenScenarioParam){
|
|
@@ -1140,7 +1140,7 @@ aotest.run=function(testName=null,scenarioName=null){
|
|
|
1140
1140
|
|
|
1141
1141
|
} else { // IF NOT (functionDefinition && functionParametersPopulated)
|
|
1142
1142
|
// If no function is the actual object of the test, but if all is in the expected
|
|
1143
|
-
// result function
|
|
1143
|
+
// result function(example : for UI tests !) :
|
|
1144
1144
|
// (reminder : if functionParametersPopulated array is NULL, then we don't
|
|
1145
1145
|
// want to execute the function !!)
|
|
1146
1146
|
|
|
@@ -1561,14 +1561,14 @@ aotest.run=function(testName=null,scenarioName=null){
|
|
|
1561
1561
|
console.log("TOTAL RESULT :",allTestsResultObj);
|
|
1562
1562
|
|
|
1563
1563
|
|
|
1564
|
-
aotest.isRunning=false;
|
|
1564
|
+
window.aotest.isRunning=false;
|
|
1565
1565
|
|
|
1566
1566
|
return allTestsResultObj;
|
|
1567
1567
|
};
|
|
1568
1568
|
|
|
1569
1569
|
|
|
1570
1570
|
|
|
1571
|
-
aotest.profile=function(rootObject,methodName,visited=[]){
|
|
1571
|
+
window.aotest.profile=function(rootObject,methodName,visited=[]){
|
|
1572
1572
|
|
|
1573
1573
|
|
|
1574
1574
|
//if(!rootObject || !isObject(rootObject) || contains(visited,rootObject)) return;
|
|
@@ -1599,7 +1599,7 @@ aotest.profile=function(rootObject,methodName,visited=[]){
|
|
|
1599
1599
|
// DBG
|
|
1600
1600
|
if(attrName==="currentContainer") lognow("currentContainer:",attr);
|
|
1601
1601
|
|
|
1602
|
-
aotest.profile(attr,methodName,visited);
|
|
1602
|
+
window.aotest.profile(attr,methodName,visited);
|
|
1603
1603
|
|
|
1604
1604
|
});
|
|
1605
1605
|
|
|
@@ -1914,7 +1914,7 @@ window.generateRandomString=function(length,/*NULLABLE*/mode=null, separator="~>
|
|
|
1914
1914
|
return result;
|
|
1915
1915
|
};
|
|
1916
1916
|
|
|
1917
|
-
window.generateRandomStringFromOriginalString=function
|
|
1917
|
+
window.generateRandomStringFromOriginalString=function(str, randomFactor=1, mode=null){
|
|
1918
1918
|
const strLength=str.length;
|
|
1919
1919
|
const maxStrLength=strLength*randomFactor;
|
|
1920
1920
|
const numberOfCharactersToChange=Math.getRandomInt(maxStrLength);
|
|
@@ -2328,7 +2328,7 @@ window.getLast=function(associativeOrNormalArray){
|
|
|
2328
2328
|
/*
|
|
2329
2329
|
* KEEP CODE : (interesting syntax...!) function getFunctionName(fn){ var f =
|
|
2330
2330
|
* typeof fn == 'function'; var s=f && ((fn.name && ['', fn.name ]) ||
|
|
2331
|
-
* fn.toString().match(/function
|
|
2331
|
+
* fn.toString().match(/function([^\(]+)/)); return (!f && 'not a function') ||
|
|
2332
2332
|
* (s && s[1] || 'anonymous'); }
|
|
2333
2333
|
*/
|
|
2334
2334
|
// NOT AOTESTABLE !
|
|
@@ -2336,7 +2336,7 @@ window.getFunctionName=function(fn){
|
|
|
2336
2336
|
// Case not a function :
|
|
2337
2337
|
if(typeof fn !== "function")
|
|
2338
2338
|
return null;
|
|
2339
|
-
var name=fn.toString().match(/function
|
|
2339
|
+
var name=fn.toString().match(/function\w*([^\(]+)/);
|
|
2340
2340
|
// Case not anonymous function :
|
|
2341
2341
|
if(!name || name.length <= 0 || !name[1])
|
|
2342
2342
|
return null;
|
|
@@ -2503,7 +2503,7 @@ window.LZWString={
|
|
|
2503
2503
|
}
|
|
2504
2504
|
},
|
|
2505
2505
|
|
|
2506
|
-
produceW : function
|
|
2506
|
+
produceW : function(context){
|
|
2507
2507
|
if(Object.prototype.hasOwnProperty.call(context.dictionaryToCreate,context.w)){
|
|
2508
2508
|
if(context.w.charCodeAt(0)<256){
|
|
2509
2509
|
this.writeBits(context.numBits, 0, context.data);
|
|
@@ -2528,7 +2528,7 @@ window.LZWString={
|
|
|
2528
2528
|
}
|
|
2529
2529
|
},
|
|
2530
2530
|
|
|
2531
|
-
/*public*/compress: function
|
|
2531
|
+
/*public*/compress: function(uncompressed){
|
|
2532
2532
|
var context={
|
|
2533
2533
|
dictionary: {},
|
|
2534
2534
|
dictionaryToCreate: {},
|
|
@@ -2595,7 +2595,7 @@ window.LZWString={
|
|
|
2595
2595
|
return res;
|
|
2596
2596
|
},
|
|
2597
2597
|
|
|
2598
|
-
/*public*/decompress: function
|
|
2598
|
+
/*public*/decompress: function(compressed){
|
|
2599
2599
|
var dictionary={},
|
|
2600
2600
|
next,
|
|
2601
2601
|
enlargeIn=4,
|
|
@@ -2694,7 +2694,7 @@ window.startsWith=window.aotest({
|
|
|
2694
2694
|
|
|
2695
2695
|
|
|
2696
2696
|
|
|
2697
|
-
window.isValidEmail=function
|
|
2697
|
+
window.isValidEmail=function(value){
|
|
2698
2698
|
var re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
2699
2699
|
return re.test(email);
|
|
2700
2700
|
}
|
|
@@ -2978,7 +2978,7 @@ window.remove=function(array, element){
|
|
|
2978
2978
|
|
|
2979
2979
|
|
|
2980
2980
|
// CAUTION : ONLY WORKS ON Array of type ARRAYS, NOT Object ARRAYS !
|
|
2981
|
-
window.swapInArray=function
|
|
2981
|
+
window.swapInArray=function(array, i1, i2){
|
|
2982
2982
|
if(!isArray(array)){
|
|
2983
2983
|
console.log("ERROR: Parameter array is not a plain array:",array);
|
|
2984
2984
|
return;
|
|
@@ -3280,7 +3280,7 @@ window.containsIgnoreCase=function(str, chunk,/*OPTIONAL*/useRegexp){
|
|
|
3280
3280
|
return new RegExp(chunk, "gim").test(str);
|
|
3281
3281
|
};
|
|
3282
3282
|
|
|
3283
|
-
window.isString=function
|
|
3283
|
+
window.isString=function(str){
|
|
3284
3284
|
return str!=null && typeof(str)==="string";
|
|
3285
3285
|
};
|
|
3286
3286
|
|
|
@@ -4975,13 +4975,13 @@ JSON.decycle=function decycle(object, replacer, classNameAttributeName){
|
|
|
4975
4975
|
|
|
4976
4976
|
if(Array.isArray(value)){
|
|
4977
4977
|
nu=[];
|
|
4978
|
-
value.forEach(function
|
|
4978
|
+
value.forEach(function(element, i){
|
|
4979
4979
|
nu[i]=derez(element, path + "[" + i + "]");
|
|
4980
4980
|
});
|
|
4981
4981
|
} else {
|
|
4982
4982
|
//If it is an object, replicate the object.
|
|
4983
4983
|
nu={};
|
|
4984
|
-
Object.keys(value).forEach(function
|
|
4984
|
+
Object.keys(value).forEach(function(name){
|
|
4985
4985
|
// CANNOT USE stringifyObject(...) function because we are in a common, lower-level library !
|
|
4986
4986
|
nu[name]=derez( value[name], path + "[" + stringifyObject(name) + "]"
|
|
4987
4987
|
);
|
|
@@ -5034,7 +5034,7 @@ JSON.recycle=function recycle($){
|
|
|
5034
5034
|
|
|
5035
5035
|
if(value && typeof value === "object"){
|
|
5036
5036
|
if(Array.isArray(value)){
|
|
5037
|
-
value.forEach(function
|
|
5037
|
+
value.forEach(function(element, i){
|
|
5038
5038
|
if(typeof element === "object" && element !== null){
|
|
5039
5039
|
var path=element.$ref;
|
|
5040
5040
|
if(typeof path === "string" && px.test(path)){
|
|
@@ -5045,7 +5045,7 @@ JSON.recycle=function recycle($){
|
|
|
5045
5045
|
}
|
|
5046
5046
|
});
|
|
5047
5047
|
} else {
|
|
5048
|
-
Object.keys(value).forEach(function
|
|
5048
|
+
Object.keys(value).forEach(function(name){
|
|
5049
5049
|
var item=value[name];
|
|
5050
5050
|
if( item !== null && (typeof item === "object" )){
|
|
5051
5051
|
var path=item.$ref;
|
|
@@ -5470,7 +5470,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5470
5470
|
|
|
5471
5471
|
|
|
5472
5472
|
|
|
5473
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
5473
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-14:28:34)»*/
|
|
5474
5474
|
/*-----------------------------------------------------------------------------*/
|
|
5475
5475
|
|
|
5476
5476
|
|
|
@@ -5730,7 +5730,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
|
|
|
5730
5730
|
|
|
5731
5731
|
|
|
5732
5732
|
|
|
5733
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
5733
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-14:28:34)»*/
|
|
5734
5734
|
/*-----------------------------------------------------------------------------*/
|
|
5735
5735
|
|
|
5736
5736
|
|
|
@@ -8170,7 +8170,7 @@ window.WebsocketImplementation={
|
|
|
8170
8170
|
return nodeServerInstance;
|
|
8171
8171
|
},
|
|
8172
8172
|
|
|
8173
|
-
// DO NOT USE DIRECTLY, USE INSTEAD
|
|
8173
|
+
// DO NOT USE DIRECTLY, USE INSTEAD initClient(...) (this function uses connectToServer(...)) !
|
|
8174
8174
|
// NODE / BROWSER CLIENT CONNECTS TO SERVER MAIN ENTRYPOINT:
|
|
8175
8175
|
connectToServer:(serverURL, port, isSecure=false, timeout)=>{
|
|
8176
8176
|
|
|
@@ -8459,7 +8459,7 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
8459
8459
|
|
|
8460
8460
|
let isHashAsked=false;
|
|
8461
8461
|
let clearTextParam=null;
|
|
8462
|
-
let
|
|
8462
|
+
let persisterId=null;
|
|
8463
8463
|
|
|
8464
8464
|
|
|
8465
8465
|
process.argv.forEach(function (val, i){
|
aotrautils-srv/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1922",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "aotrautils-srv",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.1922",
|
|
10
10
|
"license": "HGPL-1.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"atob": "^2.1.2",
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1922",
|
|
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)",
|