aotrautils-srv 0.0.634 → 0.0.636

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 (04/10/2023-21:54:52)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/10/2023-22:45:21)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4072,31 +4072,39 @@ window.areEquivalentFlatMaps=function(o1,o2,UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAM
4072
4072
 
4073
4073
 
4074
4074
 
4075
- window.areEquivalent=function(o1,o2,flattenBeforeCompute=false, UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAME,POINTER_TO_ATTR_NAME=DEFAULT_POINTER_TO_ATTR_NAME){
4075
+ window.areEquivalent=function(obj1Param,obj2Param,flattenBeforeCompute=false, UUID_ATTR_NAME=DEFAULT_UUID_ATTR_NAME,POINTER_TO_ATTR_NAME=DEFAULT_POINTER_TO_ATTR_NAME){
4076
4076
 
4077
- if((o1!=null)!==(o2!=null) || typeof(o1)!==typeof(o2)) return false;
4078
- if(o1===null && o2===null) return true;
4077
+ if((obj1Param!=null)!==(obj2Param!=null) || typeof(obj1Param)!==typeof(obj2Param)) return false;
4078
+ if(obj1Param===null && obj2Param===null) return true;
4079
4079
 
4080
- let isArrayObj1=isArray(o1);
4081
- let isArrayObj2=isArray(o2);
4080
+ let isArrayObj1=isArray(obj1Param);
4081
+ let isArrayObj2=isArray(obj2Param);
4082
4082
  if(isArrayObj1!==isArrayObj2) return false;
4083
4083
 
4084
+ let obj1, obj2;
4084
4085
  if(flattenBeforeCompute){
4085
- o1=getAsFlatStructure(o1,true);
4086
- o2=getAsFlatStructure(o2,true);
4086
+ // NO : Because the UUIDs generation can alter the result !
4087
+ // obj1=getAsFlatStructure(obj1Param,true);
4088
+ // obj2=getAsFlatStructure(obj2Param,true);
4089
+ // YES :
4090
+ obj1=JSON.decycle(obj1Param);
4091
+ obj2=JSON.decycle(obj2Param);
4092
+ }else{
4093
+ obj1=obj1Param;
4094
+ obj2=obj2Param;
4087
4095
  }
4088
4096
 
4089
4097
  //We ignore uuid keys :
4090
4098
  const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4091
4099
 
4092
- let s1=getSignatureOnNonCycledObject(o1,false,ignoredAttributes);
4093
- let s2=getSignatureOnNonCycledObject(o2,false,ignoredAttributes);
4100
+ let s1=getSignatureOnNonCycledObject(obj1,false,ignoredAttributes);
4101
+ let s2=getSignatureOnNonCycledObject(obj2,false,ignoredAttributes);
4094
4102
 
4095
4103
  // DBG
4096
4104
  lognow("+++++++++++++++++SIGNATURE 1:",s1);
4097
4105
  lognow("+++++++++++++++++SIGNATURE 2:",s2);
4098
4106
 
4099
- return s1===s2;
4107
+ return (s1===s2);
4100
4108
  }
4101
4109
 
4102
4110
 
@@ -5104,7 +5112,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5104
5112
 
5105
5113
 
5106
5114
 
5107
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/10/2023-21:54:52)»*/
5115
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/10/2023-22:45:21)»*/
5108
5116
  /*-----------------------------------------------------------------------------*/
5109
5117
 
5110
5118
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.634",
3
+ "version": "0.0.636",
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)",