aotrautils 0.0.218 → 0.0.221

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 (22/07/2022-01:01:02)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (28/07/2022-23:09:14)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -23,7 +23,6 @@
23
23
 
24
24
 
25
25
  // COMPATIBILITY browser javascript / nodejs environment :
26
-
27
26
  if(typeof(window)==="undefined") window=global;
28
27
 
29
28
 
@@ -4828,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4827
 
4829
4828
 
4830
4829
 
4831
- /*utils CLIENT library associated with aotra version : «1.0.0.000 (22/07/2022-01:01:02)»*/
4830
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (28/07/2022-23:09:14)»*/
4832
4831
  /*-----------------------------------------------------------------------------*/
4833
4832
  /* ## Utility global methods in a browser (htmljs) client environment.
4834
4833
  *
@@ -4853,7 +4852,6 @@ if(typeof(require)!="undefined" && typeof(sjcl)=="undefined" ) sjcl = require("s
4853
4852
 
4854
4853
 
4855
4854
  // COMPATIBILITY browser javascript / nodejs environment :
4856
-
4857
4855
  if(typeof(window)==="undefined") window=global;
4858
4856
 
4859
4857
 
@@ -11678,7 +11676,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11678
11676
 
11679
11677
 
11680
11678
 
11681
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (22/07/2022-01:01:02)»*/
11679
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (28/07/2022-23:09:14)»*/
11682
11680
  /*-----------------------------------------------------------------------------*/
11683
11681
 
11684
11682
 
@@ -11701,7 +11699,6 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11701
11699
 
11702
11700
 
11703
11701
  // COMPATIBILITY browser javascript / nodejs environment :
11704
-
11705
11702
  if(typeof(window)==="undefined") window=global;
11706
11703
 
11707
11704
 
@@ -12884,7 +12881,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12884
12881
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12885
12882
 
12886
12883
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12887
- /*utils SERVER library associated with aotra version : «1.0.0.000 (22/07/2022-01:01:02)»*/
12884
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (28/07/2022-23:09:14)»*/
12888
12885
  /*-----------------------------------------------------------------------------*/
12889
12886
 
12890
12887
 
@@ -12908,7 +12905,6 @@ AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12908
12905
 
12909
12906
 
12910
12907
  // COMPATIBILITY browser javascript / nodejs environment :
12911
-
12912
12908
  if(typeof(window)==="undefined") window=global;
12913
12909
 
12914
12910
 
@@ -12944,12 +12940,12 @@ const FILE_ENCODING="utf8";
12944
12940
  if(typeof(fs)==="undefined"){
12945
12941
  // TRACE
12946
12942
  console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
12947
- window.getPersister=()=>{ return null; };
12943
+ getPersister=()=>{ return null; };
12948
12944
 
12949
12945
  }else{
12950
12946
 
12951
12947
 
12952
- window.getPersister=function(dataDirPath,suffix=""){
12948
+ getPersister=function(dataDirPath,suffix=""){
12953
12949
 
12954
12950
  let self={
12955
12951
 
@@ -13147,16 +13143,15 @@ WebsocketImplementation={
13147
13143
  // https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
13148
13144
  if(isNodeContext){
13149
13145
  if(typeof(WebSocket)==="undefined"){
13150
- WebSocket=require("ws");
13151
13146
  // TRACE
13152
13147
  console.log("«ws» SERVER library not called yet, calling it now.");
13148
+ WebSocket=require("ws");
13149
+ if(typeof(WebSocket)==="undefined"){
13150
+ // TRACE
13151
+ console.log("ERROR : «ws» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
13152
+ }
13153
13153
  return WebsocketImplementation;
13154
13154
  }
13155
- if(typeof(WebSocket)==="undefined"){
13156
- // TRACE
13157
- console.log("ERROR : «ws» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
13158
- return WebsocketImplementation;
13159
- }
13160
13155
  }
13161
13156
 
13162
13157
  }
@@ -13502,7 +13497,7 @@ WebsocketImplementation={
13502
13497
  connectToServer:(serverURL, port, isSecure=false, timeout)=>{
13503
13498
 
13504
13499
  // TRACE
13505
- lognow("INFO : Using websocket implementation : "+(WebsocketImplementation.isNodeContext?"node (server-side)":"browser (client-side)"));
13500
+ lognow("INFO : Using socket library flavor : "+(WebsocketImplementation.isNodeContext?"node (client/server-side)":"browser (client-side only)"));
13506
13501
 
13507
13502
  if(WebsocketImplementation.isNodeContext)
13508
13503
  return WebsocketImplementation.connectToServerFromNode(serverURL, port, isSecure, timeout);
@@ -13518,16 +13513,18 @@ WebsocketImplementation={
13518
13513
  /*private*/connectToServerFromNode:(serverURL, port, isSecure, timeout)=>{
13519
13514
 
13520
13515
 
13521
- // NEW : ws :
13522
- if(typeof(WebSocket)==="undefined"){
13523
- // TRACE
13524
- lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13525
- return null;
13526
- }
13527
-
13528
13516
  // NODE CLIENT MODE ONLY :
13529
13517
  let clientSocket;
13530
13518
  if(!WebsocketImplementation.useSocketIOImplementation){
13519
+
13520
+ // NEW : ws :
13521
+ if(typeof(WebSocket)==="undefined"){
13522
+ // TRACE
13523
+ lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13524
+ return null;
13525
+ }
13526
+
13527
+
13531
13528
  clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13532
13529
  }else{
13533
13530
  // NOW : socket.io :
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.218",
3
+ "version": "0.0.221",
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)",