aotrautils-srv 0.0.986 → 0.0.987
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 (
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (12/06/2024-01:38:53)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -1905,8 +1905,9 @@ window.getOrCreateAttribute=function(parentObject, attributeNameOrAttributesName
|
|
|
1905
1905
|
const attributeName=(isArray(attributeNameOrAttributesName) && attributeNameOrAttributesName.length===1)?
|
|
1906
1906
|
attributeNameOrAttributesName[0]:attributeNameOrAttributesName;
|
|
1907
1907
|
if(parentObject[attributeName]==null){
|
|
1908
|
-
// parentObject[attributeName]=defaultValue;
|
|
1909
|
-
// CAUTION : if we have defaultValue as parameter, sometimes because of the recursive call, it can refer to a persisting object ! Thus, creating a strange bug.
|
|
1908
|
+
// NO : parentObject[attributeName]=defaultValue;
|
|
1909
|
+
// BECAUSE CAUTION : if we have defaultValue as parameter, sometimes because of the recursive call, it can refer to a persisting object ! Thus, creating a strange bug.
|
|
1910
|
+
// (SO WE ALWAYS NEED TO START AS A BLANK STATE FOR DEFAULT VALUE OBJECTS !)
|
|
1910
1911
|
const DEFAULT_VALUE={};
|
|
1911
1912
|
parentObject[attributeName]=DEFAULT_VALUE;
|
|
1912
1913
|
}
|
|
@@ -1917,8 +1918,9 @@ window.getOrCreateAttribute=function(parentObject, attributeNameOrAttributesName
|
|
|
1917
1918
|
|
|
1918
1919
|
const attributeName=attributeNameOrAttributesName[0];
|
|
1919
1920
|
if(parentObject[attributeName]==null){
|
|
1920
|
-
// parentObject[attributeName]=defaultValue;
|
|
1921
|
-
// CAUTION : if we have defaultValue as parameter, sometimes because of the recursive call, it can refer to a persisting object ! Thus, creating a strange bug.
|
|
1921
|
+
// NO : parentObject[attributeName]=defaultValue;
|
|
1922
|
+
// BECAUSE CAUTION : if we have defaultValue as parameter, sometimes because of the recursive call, it can refer to a persisting object ! Thus, creating a strange bug.
|
|
1923
|
+
// (SO WE ALWAYS NEED TO START AS A BLANK STATE FOR DEFAULT VALUE OBJECTS !)
|
|
1922
1924
|
const DEFAULT_VALUE={};
|
|
1923
1925
|
parentObject[attributeName]=DEFAULT_VALUE;
|
|
1924
1926
|
}
|
|
@@ -3430,7 +3432,9 @@ Math.getRandom=function(ceil,/*OPTIONAL*/floor){// FYI : ceil>floor
|
|
|
3430
3432
|
// (random integer values from floor to ceil)
|
|
3431
3433
|
return (Math.random() * ((ceil-floor) + 1) ) + floor;
|
|
3432
3434
|
};
|
|
3433
|
-
|
|
3435
|
+
Math.getRandomBool=function(){
|
|
3436
|
+
return (1<=(Math.random()*2));
|
|
3437
|
+
};
|
|
3434
3438
|
|
|
3435
3439
|
|
|
3436
3440
|
Math.getRandomIntAroundValue=function(target, area,/*OPTIONAL*/exclusionParam){
|
|
@@ -5347,7 +5351,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5347
5351
|
|
|
5348
5352
|
|
|
5349
5353
|
|
|
5350
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (
|
|
5354
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (12/06/2024-01:38:53)»*/
|
|
5351
5355
|
/*-----------------------------------------------------------------------------*/
|
|
5352
5356
|
|
|
5353
5357
|
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.987",
|
|
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)",
|