aotrautils 0.0.149 → 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:50:48)»*/
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:50:48)»*/
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:50:48)»*/
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:50:48)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:56:03)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13285,16 +13285,9 @@ WebsocketImplementation={
13285
13285
 
13286
13286
 
13287
13287
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
13288
- else{
13289
-
13290
- // DBG
13291
- clientSocketParam.onAny((event,args) => { console.log(`MAIS PUTAIN : ${event}:`,args); });
13292
- clientSocketParam.on(channelName,(args, clientSocket) => { console.log(`MAIS OSKOUR :${args} ${clientSocket}`); });
13288
+ else clientSocketParam.on(channelName, doOnMessage);
13293
13289
 
13294
13290
 
13295
-
13296
- clientSocketParam.on(channelName, doOnMessage);
13297
- }
13298
13291
 
13299
13292
 
13300
13293
 
@@ -13741,7 +13734,17 @@ WebsocketImplementation={
13741
13734
  // const dataWrapped=JSON.parse(message);
13742
13735
  // dataWrapped=getAt(dataWrapped,0);// We get the root element
13743
13736
 
13744
- 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
+
13745
13748
 
13746
13749
 
13747
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.149",
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)",