aotrautils 0.0.1755 → 0.0.1756

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 (14/06/2025-00:05:06)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (14/06/2025-01:53:58)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -3949,26 +3949,29 @@ window.setByDottedPath=(obj, path, value)=>{
3949
3949
  }
3950
3950
 
3951
3951
  const pathParts=path.split(".");
3952
-
3953
- if(isString(obj)){
3954
- // Here we are trying to set a value inside an object, but the attribute is actually a JSON string !
3955
- try{
3956
- obj=parseJSON(obj);
3957
- }catch(error){
3958
- const lastAttributeNameInPath=pathParts[pathParts.length-1];
3959
- currentObject[lastAttributeNameInPath]=value;
3960
- return;
3961
- }
3962
- }
3963
-
3964
3952
  let currentObject=obj;
3965
3953
  for(let i=0; i<pathParts.length-1; i++) {
3954
+
3955
+ if(isString(currentObject)){
3956
+ // Here we are trying to set a value inside an object, but the attribute is actually a JSON string !
3957
+ try{
3958
+ currentObject=parseJSON(currentObject);
3959
+ }catch(error){
3960
+ // Here we have a string, and we want to set a value inside the attribute, but it's not an object !
3961
+ const subPath=pathParts.slice(i+1);
3962
+ currentObject=setByDottedPath=(currentObject, subPath.join("."), value);
3963
+ return;
3964
+ }
3965
+ }
3966
+
3966
3967
  const part=pathParts[i];
3968
+ // We create the sub-object if not already present:
3967
3969
  if(!(part in currentObject)) {
3968
3970
  const nextIsIndex=(!isNaN(pathParts[i + 1]));
3969
3971
  currentObject[part]=(nextIsIndex ? [] : {});
3970
3972
  }
3971
3973
  currentObject=currentObject[part];
3974
+
3972
3975
  }
3973
3976
  const lastAttributeNameInPath=pathParts[pathParts.length-1];
3974
3977
  currentObject[lastAttributeNameInPath]=value;
@@ -3976,6 +3979,7 @@ window.setByDottedPath=(obj, path, value)=>{
3976
3979
 
3977
3980
 
3978
3981
 
3982
+
3979
3983
  getUUID=function(mode=null){
3980
3984
 
3981
3985
  let uuid="";
@@ -5005,7 +5009,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5005
5009
 
5006
5010
 
5007
5011
 
5008
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (14/06/2025-00:05:06)»*/
5012
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (14/06/2025-01:53:58)»*/
5009
5013
  /*-----------------------------------------------------------------------------*/
5010
5014
  /* ## Utility global methods in a browser (htmljs) client environment.
5011
5015
  *
@@ -13606,7 +13610,7 @@ getAORTACClient=function(clientId=getUUID(), serverNodeOrigin="ws://127.0.0.1:40
13606
13610
 
13607
13611
 
13608
13612
 
13609
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (14/06/2025-00:05:06)»*/
13613
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (14/06/2025-01:53:58)»*/
13610
13614
  /*-----------------------------------------------------------------------------*/
13611
13615
 
13612
13616
 
@@ -14845,7 +14849,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14845
14849
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14846
14850
 
14847
14851
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14848
- /*utils AI library associated with aotra version : «1_29072022-2359 (14/06/2025-00:05:06)»*/
14852
+ /*utils AI library associated with aotra version : «1_29072022-2359 (14/06/2025-01:53:58)»*/
14849
14853
  /*-----------------------------------------------------------------------------*/
14850
14854
 
14851
14855
 
@@ -14991,7 +14995,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14991
14995
 
14992
14996
 
14993
14997
 
14994
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (14/06/2025-00:05:06)»*/
14998
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (14/06/2025-01:53:58)»*/
14995
14999
  /*-----------------------------------------------------------------------------*/
14996
15000
 
14997
15001
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1755",
3
+ "version": "0.0.1756",
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)",