aotrautils 0.0.1206 → 0.0.1208

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 (30/03/2025-02:27:24)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:12)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4059,7 +4059,7 @@ window.areEquivalentFlatMaps=function(o1,o2,UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAM
4059
4059
  if((o1!=null)!==(o2!=null)) return false;
4060
4060
 
4061
4061
  // We ignore uuid keys :
4062
- const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4062
+ //const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4063
4063
 
4064
4064
 
4065
4065
  if(Object.keys(o1).length!==Object.keys(o2).length){
@@ -4079,7 +4079,8 @@ window.areEquivalentFlatMaps=function(o1,o2,UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAM
4079
4079
 
4080
4080
  let entry=o1[key];
4081
4081
 
4082
- let s1=hashSafe(getSignatureOnNonCycledObject(entry,false,ignoredAttributes));
4082
+ //let s1=hashSafe(getSignatureOnNonCycledObject(entry,false,ignoredAttributes));
4083
+ let s1=hashSafe(getSignatureOnFlatObject(entry,false));
4083
4084
  signatures1.push(s1);
4084
4085
 
4085
4086
  },()=>{ return true; }
@@ -4091,7 +4092,8 @@ window.areEquivalentFlatMaps=function(o1,o2,UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAM
4091
4092
 
4092
4093
  let entry=o2[key];
4093
4094
 
4094
- let s2=hashSafe(getSignatureOnNonCycledObject(entry,false,ignoredAttributes));
4095
+ //let s2=hashSafe(getSignatureOnNonCycledObject(entry,false,ignoredAttributes));
4096
+ let s2=hashSafe(getSignatureOnObject(entry,false));
4095
4097
 
4096
4098
  if(!contains(signatures1,s2)){
4097
4099
 
@@ -4251,10 +4253,11 @@ window.areEquivalent=function(obj1Param,obj2Param,flattenBeforeCompute=false, UU
4251
4253
  }
4252
4254
 
4253
4255
  //We ignore uuid keys :
4254
- const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4255
-
4256
- let s1=getSignatureOnNonCycledObject(obj1,false,ignoredAttributes);
4257
- let s2=getSignatureOnNonCycledObject(obj2,false,ignoredAttributes);
4256
+ //const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4257
+ //let s1=getSignatureOnNonCycledObject(obj1,false,ignoredAttributes);
4258
+ //let s2=getSignatureOnNonCycledObject(obj2,false,ignoredAttributes);
4259
+ let s1=getSignatureOnObject(obj1, false);
4260
+ let s2=getSignatureOnObject(obj2, false);
4258
4261
 
4259
4262
  // DBG
4260
4263
  //lognow("+++++++++++++++++SIGNATURE 1:",s1);
@@ -4350,8 +4353,25 @@ window.calculateProtoDelta=function(obj1,obj2,
4350
4353
  return result;
4351
4354
  };
4352
4355
 
4356
+
4357
+ /*public*/window.getSignatureOnObject=function(obj, isHashed=true){
4358
+ // We always flatten the input object first :
4359
+ const flatObj=getAsFlatStructure(obj);
4360
+
4361
+ return getSignatureOnFlatObject(flatObj, isHashed);
4362
+ }
4363
+
4364
+ /*public*/window.getSignatureOnFlatObject=function(flatObj, isHashed=true){
4365
+
4366
+ // We construct a simple array, to get rid of the identifiers values :
4367
+ foreach(flatObj,item=>flatArray.push(item));
4368
+
4369
+ return getSignatureOnNonCycledObject(flatObj, isHashed, [DEFAULT_UUID_ATTR_NAME, DEFAULT_POINTER_TO_ATTR_NAME]);
4370
+ }
4371
+
4372
+ // DO NOT CALL DIRECTLY :
4353
4373
  // CAUTION : will cause an INFINITE LOOP if the object contains a CYCLE !
4354
- /*private*/window.getSignatureOnNonCycledObject=function(obj,isHashed=true,attributesNamesToIgnore=null){
4374
+ /*private*/window.getSignatureOnNonCycledObject=function(obj, isHashed=true, attributesNamesToIgnore=null){
4355
4375
  var result="";
4356
4376
  if(obj==null) return "null";
4357
4377
  if(isPrimitive(obj)) return ""+obj;
@@ -4848,7 +4868,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4848
4868
 
4849
4869
 
4850
4870
 
4851
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:24)»*/
4871
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:12)»*/
4852
4872
  /*-----------------------------------------------------------------------------*/
4853
4873
  /* ## Utility global methods in a browser (htmljs) client environment.
4854
4874
  *
@@ -13420,7 +13440,7 @@ getAORTACClient=function(clientId=getUUID(), serverNodeOrigin="ws://127.0.0.1:40
13420
13440
 
13421
13441
 
13422
13442
 
13423
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:24)»*/
13443
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:12)»*/
13424
13444
  /*-----------------------------------------------------------------------------*/
13425
13445
 
13426
13446
 
@@ -14659,7 +14679,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14659
14679
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14660
14680
 
14661
14681
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14662
- /*utils AI library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:24)»*/
14682
+ /*utils AI library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:12)»*/
14663
14683
  /*-----------------------------------------------------------------------------*/
14664
14684
 
14665
14685
 
@@ -14803,7 +14823,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14803
14823
 
14804
14824
 
14805
14825
 
14806
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:24)»*/
14826
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:12)»*/
14807
14827
  /*-----------------------------------------------------------------------------*/
14808
14828
 
14809
14829
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1206",
3
+ "version": "0.0.1208",
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)",