aotrautils-srv 0.0.152 → 0.0.153

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:46:42)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-03:50:48)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:46:42)»*/
4831
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:50:48)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
 
4834
4834
 
@@ -5177,7 +5177,15 @@ WebsocketImplementation={
5177
5177
 
5178
5178
  // dataWrapped=JSON.parse(dataWrapped);
5179
5179
  // dataWrapped=getAt(dataWrapped,0);// We get the root element
5180
- const dataWrapped=(WebsocketImplementation.useFlatStrings?JSON.parse(message):message);
5180
+
5181
+ let dataWrapped=message;
5182
+ try{
5183
+ dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
5184
+ }catch(error1){
5185
+ // TRACE
5186
+ lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
5187
+ dataWrapped=(isString(message)?message:JSON.stringify(message));
5188
+ }
5181
5189
 
5182
5190
 
5183
5191
  // DBG
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.152",
3
+ "version": "0.0.153",
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)",