aotrautils-srv 0.0.1212 → 0.0.1214

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:27)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:15)»*/
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 AI library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:27)»*/
4871
+ /*utils AI library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:15)»*/
4852
4872
  /*-----------------------------------------------------------------------------*/
4853
4873
 
4854
4874
 
@@ -4992,7 +5012,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
4992
5012
 
4993
5013
 
4994
5014
 
4995
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/03/2025-02:27:27)»*/
5015
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/03/2025-02:52:15)»*/
4996
5016
  /*-----------------------------------------------------------------------------*/
4997
5017
 
4998
5018
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1212",
3
+ "version": "0.0.1214",
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)",