aotrautils 0.0.510 → 0.0.511

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 (05/02/2023-22:56:27)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4866,7 +4866,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4866
4866
 
4867
4867
 
4868
4868
 
4869
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (05/02/2023-22:56:27)»*/
4869
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
4870
4870
  /*-----------------------------------------------------------------------------*/
4871
4871
  /* ## Utility global methods in a browser (htmljs) client environment.
4872
4872
  *
@@ -6652,8 +6652,49 @@ base64StringToIntArray=function(dataURI){
6652
6652
  }
6653
6653
  // return new Uint8Array(array);
6654
6654
  return array;
6655
+ };
6656
+
6657
+ // DOES NOT SEEM TO WORK (for images src for instance)
6658
+ intArrayToBase64String=function(intArray, addAlphaCharacter=false){
6659
+ let result="";
6660
+ if(!intArray || !isArray(intArray)){
6661
+ // TRACE
6662
+ lognow("ERROR : Int array is not an array. Aborting. Array parameter :",intArray);
6663
+ return result;
6664
+ }
6665
+ foreach(intArray,(i, index)=>{
6666
+ result+=String.fromCharCode(i);
6667
+ if(addAlphaCharacter && (index%3)==0)
6668
+ result+=String.fromCharCode(255);
6669
+ });
6670
+ result=btoa(result);
6671
+ return result;
6672
+ };
6673
+
6674
+ // UNUSED :
6675
+ //intArrayToBlob=function(intArray, type="image/bmp" /*other values : "image/jpeg", "image/png"*/){
6676
+ // if(!intArray || !isArray(intArray)){
6677
+ // // TRACE
6678
+ // lognow("ERROR : Int array is not an array. Aborting. Array parameter :",intArray);
6679
+ // return URL.createObjectURL(new Blob());
6680
+ // }
6681
+ //
6682
+ //// let str="";
6683
+ //// foreach(intArray,(i)=>{
6684
+ //// str+=String.fromCharCode(i);
6685
+ //// });
6686
+ //// let blob=new Blob([str], {type: type});
6687
+ //
6688
+ // let arr=new Uint8Array(intArray);
6689
+ // let blob=new Blob([arr.buffer], {type: type});
6690
+ //
6691
+ // const result = URL.createObjectURL(blob);
6692
+ // return result;
6693
+ //};
6694
+
6695
+
6696
+
6655
6697
 
6656
- }
6657
6698
 
6658
6699
 
6659
6700
  function addAlphaCanalIfNecessary(videoRawData, /*OPTIONAL*/isMessWithAlpha=false){
@@ -9413,7 +9454,6 @@ arrayToString=function(arr,compressResult=true,precisionFraction=null,isSigned=f
9413
9454
  // if(compressResult) str=LZWString.compress(str);
9414
9455
 
9415
9456
  return str;
9416
-
9417
9457
  }
9418
9458
 
9419
9459
  // if signed :
@@ -13038,7 +13078,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13038
13078
  };
13039
13079
 
13040
13080
 
13041
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (05/02/2023-22:56:27)»*/
13081
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
13042
13082
  /*-----------------------------------------------------------------------------*/
13043
13083
 
13044
13084
 
@@ -14266,7 +14306,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14266
14306
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14267
14307
 
14268
14308
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14269
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/02/2023-22:56:27)»*/
14309
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
14270
14310
  /*-----------------------------------------------------------------------------*/
14271
14311
 
14272
14312
 
@@ -15220,8 +15260,7 @@ WebsocketImplementation={
15220
15260
  if(listenerConfig && listenerConfig.destroyListenerAfterReceiving)
15221
15261
  remove(browserInstance.receptionEntryPoints,receptionEntryPoint);
15222
15262
 
15223
- // DBG
15224
- lognow("browserInstance.receptionEntryPoints("+browserInstance.receptionEntryPoints.length+"):",browserInstance.receptionEntryPoints);
15263
+
15225
15264
 
15226
15265
  }
15227
15266
  };
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.510",
3
+ "version": "0.0.511",
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)",