aotrautils-srv 0.0.634 → 0.0.635

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:42:32)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4072,31 +4072,35 @@ 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
4084
  if(flattenBeforeCompute){
4085
- o1=getAsFlatStructure(o1,true);
4086
- o2=getAsFlatStructure(o2,true);
4085
+ // NO : Because the UUIDs generation can alter the result !
4086
+ // obj1=getAsFlatStructure(obj1Param,true);
4087
+ // obj2=getAsFlatStructure(obj2Param,true);
4088
+ // YES :
4089
+ obj1=JSON.decycle(obj1Param);
4090
+ obj2=JSON.decycle(obj2Param);
4087
4091
  }
4088
4092
 
4089
4093
  //We ignore uuid keys :
4090
4094
  const ignoredAttributes=[UUID_ATTR_NAME,POINTER_TO_ATTR_NAME];
4091
4095
 
4092
- let s1=getSignatureOnNonCycledObject(o1,false,ignoredAttributes);
4093
- let s2=getSignatureOnNonCycledObject(o2,false,ignoredAttributes);
4096
+ let s1=getSignatureOnNonCycledObject(obj1,false,ignoredAttributes);
4097
+ let s2=getSignatureOnNonCycledObject(obj2,false,ignoredAttributes);
4094
4098
 
4095
4099
  // DBG
4096
4100
  lognow("+++++++++++++++++SIGNATURE 1:",s1);
4097
4101
  lognow("+++++++++++++++++SIGNATURE 2:",s2);
4098
4102
 
4099
- return s1===s2;
4103
+ return (s1===s2);
4100
4104
  }
4101
4105
 
4102
4106
 
@@ -5104,7 +5108,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5104
5108
 
5105
5109
 
5106
5110
 
5107
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/10/2023-21:54:52)»*/
5111
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/10/2023-22:42:32)»*/
5108
5112
  /*-----------------------------------------------------------------------------*/
5109
5113
 
5110
5114
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.634",
3
+ "version": "0.0.635",
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)",