aotrautils 0.0.547 → 0.0.549
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.
- aotrautils/aotrautils.build.js +18 -14
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2023-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2023-11:49:54)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -1843,24 +1843,28 @@ window.nothing=function(nullable, insist=false){
|
|
|
1843
1843
|
return false;
|
|
1844
1844
|
}
|
|
1845
1845
|
|
|
1846
|
-
window.getOrCreateAttribute=function(parentObject,
|
|
1846
|
+
window.getOrCreateAttribute=function(parentObject, attributeNameOrAttributesName, defaultValue={}){
|
|
1847
1847
|
if(nothing(parentObject)) return null;
|
|
1848
|
-
if(nothing(
|
|
1849
|
-
if(isString(
|
|
1850
|
-
const attributeName=
|
|
1848
|
+
if(nothing(attributeNameOrAttributesName)) return parentObject;
|
|
1849
|
+
if(isString(attributeNameOrAttributesName) || (isArray(attributeNameOrAttributesName) && attributeNameOrAttributesName.length===1)){
|
|
1850
|
+
const attributeName=(isArray(attributeNameOrAttributesName) && attributeNameOrAttributesName.length===1)?
|
|
1851
|
+
attributeNameOrAttributesName[0]:attributeNameOrAttributesName;
|
|
1851
1852
|
if(parentObject[attributeName]==null && defaultValue!=null){
|
|
1852
1853
|
parentObject[attributeName]=defaultValue;
|
|
1853
1854
|
}
|
|
1854
1855
|
return parentObject[attributeName];
|
|
1855
1856
|
}
|
|
1856
|
-
if(isArray(
|
|
1857
|
-
let item=parentObject;
|
|
1858
|
-
foreach(
|
|
1859
|
-
|
|
1860
|
-
});
|
|
1857
|
+
if(isArray(attributeNameOrAttributesName)){
|
|
1858
|
+
// let item=parentObject;
|
|
1859
|
+
// foreach(attributeNameOrAttributesName,(attributeName)=>{
|
|
1860
|
+
// const child=getOrCreateAttribute(item, attributeName, defaultValue);
|
|
1861
|
+
// });
|
|
1862
|
+
const item=getOrCreateAttribute(parentObject, attributeNameOrAttributesName[0],
|
|
1863
|
+
getOrCreateAttribute(parentObject, attributeNameOrAttributesName.splice(1), defaultValue) );
|
|
1864
|
+
|
|
1861
1865
|
return item;
|
|
1862
1866
|
}
|
|
1863
|
-
return
|
|
1867
|
+
return parentObject;
|
|
1864
1868
|
}
|
|
1865
1869
|
|
|
1866
1870
|
window.nonull=function(value,defaultValue){
|
|
@@ -4950,7 +4954,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4950
4954
|
|
|
4951
4955
|
|
|
4952
4956
|
|
|
4953
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/07/2023-
|
|
4957
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/07/2023-11:49:54)»*/
|
|
4954
4958
|
/*-----------------------------------------------------------------------------*/
|
|
4955
4959
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4956
4960
|
*
|
|
@@ -13217,7 +13221,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
13217
13221
|
|
|
13218
13222
|
|
|
13219
13223
|
|
|
13220
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2023-
|
|
13224
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2023-11:49:54)»*/
|
|
13221
13225
|
/*-----------------------------------------------------------------------------*/
|
|
13222
13226
|
|
|
13223
13227
|
|
|
@@ -14456,7 +14460,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14456
14460
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14457
14461
|
|
|
14458
14462
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14459
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (26/07/2023-
|
|
14463
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (26/07/2023-11:49:54)»*/
|
|
14460
14464
|
/*-----------------------------------------------------------------------------*/
|
|
14461
14465
|
|
|
14462
14466
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.549",
|
|
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)",
|