aotrautils 0.0.147 → 0.0.150

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.0.0.000 (17/07/2022-03:43:04)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-03:56:03)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-03:43:04)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-03:56:03)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
  /* ## Utility global methods in a browser (htmljs) client environment.
4834
4834
  *
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11678
11678
 
11679
11679
 
11680
11680
 
11681
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-03:43:04)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-03:56:03)»*/
11682
11682
  /*-----------------------------------------------------------------------------*/
11683
11683
 
11684
11684
 
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12884
12884
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12885
12885
 
12886
12886
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12887
- /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:43:04)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:56:03)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13233,12 +13233,21 @@ WebsocketImplementation={
13233
13233
 
13234
13234
  // dataWrapped=JSON.parse(dataWrapped);
13235
13235
  // dataWrapped=getAt(dataWrapped,0);// We get the root element
13236
- const dataWrapped=(WebsocketImplementation.useFlatStrings?JSON.parse(message):message);
13236
+
13237
+ let dataWrapped=message;
13238
+ try{
13239
+ dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
13240
+ }catch(error1){
13241
+ // TRACE
13242
+ lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
13243
+ dataWrapped=(isString(message)?message:JSON.stringify(message));
13244
+ }
13237
13245
 
13238
13246
 
13239
13247
  // DBG
13240
13248
  lognow(" Channel information:dataWrapped",dataWrapped);
13241
- lognow(" Channel information:dataWrapped.channelName«"+receptionEntryPoint.channelName+"»");
13249
+ lognow(" Channel information:dataWrapped",JSON.stringify(dataWrapped));
13250
+ lognow(" Channel information:dataWrapped.channelName«"+dataWrapped.channelName+"»");
13242
13251
  lognow(" Channel information:receptionEntryPoint.channelName«"+receptionEntryPoint.channelName+"»");
13243
13252
  lognow(" C1",(dataWrapped.channelName!=receptionEntryPoint.channelName));
13244
13253
  lognow(" C2",(dataWrapped.channelName!==receptionEntryPoint.channelName));
@@ -13276,16 +13285,9 @@ WebsocketImplementation={
13276
13285
 
13277
13286
 
13278
13287
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
13279
- else{
13280
-
13281
- // DBG
13282
- clientSocketParam.onAny((event,args) => { console.log(`MAIS PUTAIN : ${event}:`,args); });
13283
- clientSocketParam.on(channelName,(args, clientSocket) => { console.log(`MAIS OSKOUR :${args} ${clientSocket}`); });
13284
-
13288
+ else clientSocketParam.on(channelName, doOnMessage);
13285
13289
 
13286
13290
 
13287
- clientSocketParam.on(channelName, doOnMessage);
13288
- }
13289
13291
 
13290
13292
 
13291
13293
 
@@ -13732,7 +13734,17 @@ WebsocketImplementation={
13732
13734
  // const dataWrapped=JSON.parse(message);
13733
13735
  // dataWrapped=getAt(dataWrapped,0);// We get the root element
13734
13736
 
13735
- const dataWrapped=(WebsocketImplementation.useFlatStrings?JSON.parse(message):message);
13737
+
13738
+ let dataWrapped=message;
13739
+ try{
13740
+ dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
13741
+ }catch(error1){
13742
+ // TRACE
13743
+ lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
13744
+ dataWrapped=(isString(message)?message:JSON.stringify(message));
13745
+ }
13746
+
13747
+
13736
13748
 
13737
13749
 
13738
13750
  // Channel information is stored in exchanged data :
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.147",
3
+ "version": "0.0.150",
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)",