aotrautils 0.0.444 → 0.0.445

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 (23/01/2023-22:48:20)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (23/01/2023-23:00:21)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -2858,12 +2858,11 @@ window.contains=function(container, objectToFind,/*OPTIONAL*/useRegexp=false,sea
2858
2858
  // console.log("WARN : Container is empty ! Cannot search for «"+objectToFind+"».");
2859
2859
  return false;
2860
2860
  }
2861
- // if(!isString(container) && objectToFind && isFunction(objectToFind)){
2862
- // return !!foreach(container, (item, keyOrIndex)=>{
2863
- // if(objectToFind(item, keyOrIndex)) return true;
2864
- // });
2865
- // }else
2866
- {
2861
+ if(!isString(container) && objectToFind && isFunction(objectToFind)){
2862
+ return !!foreach(container, (item, keyOrIndex)=>{
2863
+ if(objectToFind(item, keyOrIndex)) return true;
2864
+ });
2865
+ }else{
2867
2866
  // Note : We also allow the search of null plain items in a container !
2868
2867
 
2869
2868
  if(isArray(container)){
@@ -4865,7 +4864,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4865
4864
 
4866
4865
 
4867
4866
 
4868
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (23/01/2023-22:48:20)»*/
4867
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (23/01/2023-23:00:21)»*/
4869
4868
  /*-----------------------------------------------------------------------------*/
4870
4869
  /* ## Utility global methods in a browser (htmljs) client environment.
4871
4870
  *
@@ -12987,7 +12986,7 @@ createOritaMicroClient=function(url, port, isNode=false){
12987
12986
  };
12988
12987
 
12989
12988
 
12990
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (23/01/2023-22:48:20)»*/
12989
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (23/01/2023-23:00:21)»*/
12991
12990
  /*-----------------------------------------------------------------------------*/
12992
12991
 
12993
12992
 
@@ -14215,7 +14214,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14215
14214
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14216
14215
 
14217
14216
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14218
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (23/01/2023-22:48:20)»*/
14217
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (23/01/2023-23:00:21)»*/
14219
14218
  /*-----------------------------------------------------------------------------*/
14220
14219
 
14221
14220
 
@@ -15113,36 +15112,36 @@ WebsocketImplementation={
15113
15112
  lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelNameParam);
15114
15113
 
15115
15114
 
15116
- // const receptionEntryPoint={
15117
- // channelName:channelNameParam,
15118
- // clientsRoomsTag:clientsRoomsTag,
15119
- // // TODO : ADD TO ALL OTHER SUBSYSTEMS !
15120
- // id:receptionEntryPointId,
15121
- //
15122
- // execute:(eventOrMessage)=>{
15123
- //
15124
- // const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
15125
- //
15126
- //// // DBG
15127
- //// lognow("(CLIENT) (DEBUG) CLIENT RECEIVED SOMETHING FROM SERVER :",dataWrapped);
15128
- //
15129
- // // Channel information is stored in exchanged data :
15130
- // if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
15131
- //
15132
- // const clientSocket=browserInstance.clientSocket;
15133
- //
15134
- // // Room information is stored in client socket object :
15135
- // if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
15136
- //
15137
- // if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data, clientSocket);
15138
- //
15139
- //
15140
- // }
15141
- // };
15142
- //
15143
- // // TODO : ADD TO ALL OTHER SUBSYSTEMS !
15144
- // if(!contains(browserInstance.receptionEntryPoints,(l)=>(l.id && receptionEntryPoint.id && l.id===receptionEntryPoint.id)))
15145
- // browserInstance.receptionEntryPoints.push(receptionEntryPoint);
15115
+ const receptionEntryPoint={
15116
+ channelName:channelNameParam,
15117
+ clientsRoomsTag:clientsRoomsTag,
15118
+ // TODO : ADD TO ALL OTHER SUBSYSTEMS !
15119
+ id:receptionEntryPointId,
15120
+
15121
+ execute:(eventOrMessage)=>{
15122
+
15123
+ const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
15124
+
15125
+ // // DBG
15126
+ // lognow("(CLIENT) (DEBUG) CLIENT RECEIVED SOMETHING FROM SERVER :",dataWrapped);
15127
+
15128
+ // Channel information is stored in exchanged data :
15129
+ if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
15130
+
15131
+ const clientSocket=browserInstance.clientSocket;
15132
+
15133
+ // Room information is stored in client socket object :
15134
+ if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
15135
+
15136
+ if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data, clientSocket);
15137
+
15138
+
15139
+ }
15140
+ };
15141
+
15142
+ // TODO : ADD TO ALL OTHER SUBSYSTEMS !
15143
+ if(!contains(browserInstance.receptionEntryPoints,(l)=>(l.id && receptionEntryPoint.id && l.id===receptionEntryPoint.id)))
15144
+ browserInstance.receptionEntryPoints.push(receptionEntryPoint);
15146
15145
 
15147
15146
 
15148
15147
  return browserInstance;
@@ -15157,19 +15156,19 @@ WebsocketImplementation={
15157
15156
  // CURRENT
15158
15157
  sendChainable:(channelNameParam, data, clientsRoomsTag=null)=>{
15159
15158
 
15160
- // browserInstance.send(channelNameParam, data, clientsRoomsTag);
15161
- //
15162
- // const resultPromise={
15163
- // clientsRoomsTag:clientsRoomsTag,
15164
- // thenWhenReceiveMessageType:(channelNameForResponse, messageTypeForResponse, doOnIncomingMessageForResponse)=>{
15165
- // const listenerId=messageTypeForResponse;
15166
- // browserInstance.receive(channelNameForResponse, doOnIncomingMessageForResponse, this.clientsRoomsTag, listenerId);
15167
- // return this;
15168
- // }
15169
- // };
15170
- //
15171
- //
15172
- // return resultPromise;
15159
+ browserInstance.send(channelNameParam, data, clientsRoomsTag);
15160
+
15161
+ const resultPromise={
15162
+ clientsRoomsTag:clientsRoomsTag,
15163
+ thenWhenReceiveMessageType:(channelNameForResponse, messageTypeForResponse, doOnIncomingMessageForResponse)=>{
15164
+ const listenerId=messageTypeForResponse;
15165
+ browserInstance.receive(channelNameForResponse, doOnIncomingMessageForResponse, this.clientsRoomsTag, listenerId);
15166
+ return this;
15167
+ }
15168
+ };
15169
+
15170
+
15171
+ return resultPromise;
15173
15172
  },
15174
15173
 
15175
15174
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.444",
3
+ "version": "0.0.445",
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)",