aotrautils 0.0.1831 → 0.0.1833

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 (17/03/2026-16:50:29)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -1939,6 +1939,70 @@ function getUniqueIdWithDate(){
1939
1939
 
1940
1940
 
1941
1941
 
1942
+
1943
+ //const str="aaaadbbbss44444dfdssfAAAAArrrrrRRRRRRRRRRrrrrrrrr";
1944
+
1945
+ window.encodeStringRLE=function(str){
1946
+
1947
+ let encodedStr="";
1948
+ let nextChar=null;
1949
+ let count=1;
1950
+ let isFirst=true;
1951
+ for(let i=0;i<str.length;i++){
1952
+
1953
+ const c=""+str.charAt(i);
1954
+ if(i<str.length)
1955
+ nextChar=""+str.charAt(i+1);
1956
+
1957
+ if(c!=null){
1958
+ if(nextChar==c){
1959
+ count++;
1960
+ }else{
1961
+ if(!isFirst) encodedStr+=",";
1962
+ else isFirst=false;
1963
+ encodedStr+=count+c;
1964
+ count=1;
1965
+ }
1966
+ }
1967
+ }
1968
+ // console.log(encodedStr);
1969
+
1970
+ return encodedStr;
1971
+ }
1972
+
1973
+
1974
+ window.decodeStringRLE=function(encodedStr){
1975
+
1976
+ let decodedStr="";
1977
+ let numberString=""
1978
+
1979
+ const splits=encodedStr.split(",");
1980
+ for(let k=0;k<splits.length;k++){
1981
+ const split=splits[k];
1982
+
1983
+ for(let i=0;i<split.length-1;i++){
1984
+ const c=split.charAt(i);
1985
+ numberString+=c;
1986
+ }
1987
+
1988
+ const character=split.charAt(split.length-1);
1989
+ for(let j=0;j<parseInt(numberString);j++){
1990
+ decodedStr+=character;
1991
+ }
1992
+ numberString="";
1993
+
1994
+ }
1995
+
1996
+ // console.log(decodedStr);
1997
+
1998
+ return decodedStr;
1999
+ }
2000
+
2001
+
2002
+
2003
+
2004
+
2005
+
1942
2006
  //================================================================
1943
2007
  //================= Miscelanneous utility methods =================
1944
2008
  //================================================================
@@ -2228,11 +2292,11 @@ window.findInArray=function(collection, equalsFunction, returnFunction=null){
2228
2292
  }, equalsFunction);
2229
2293
  }
2230
2294
 
2231
- window.getKeyAt=function(associativeOrNormalArray,index){
2295
+ window.getKeyAt=function(associativeOrNormalArray,index=0){
2232
2296
  return getAt(associativeOrNormalArray,index,true);
2233
2297
  }
2234
2298
 
2235
- window.getAt=function(associativeOrNormalArray,index,returnKey=false){
2299
+ window.getAt=function(associativeOrNormalArray,index=0,returnKey=false){
2236
2300
  if(empty(associativeOrNormalArray)) return null;
2237
2301
  let i=0;
2238
2302
  // CAUTION : Only use this «return foreach» syntax with SINGLE-LEVEL nested loops ONLY !
@@ -5076,7 +5140,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5076
5140
 
5077
5141
 
5078
5142
 
5079
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (17/03/2026-16:50:29)»*/
5143
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
5080
5144
  /*-----------------------------------------------------------------------------*/
5081
5145
  /* ## Utility global methods in a browser (htmljs) client environment.
5082
5146
  *
@@ -5754,7 +5818,7 @@ function escapeHTML(str){
5754
5818
  }
5755
5819
 
5756
5820
 
5757
- function startsWithUpperCase(str){
5821
+ window.startsWithUpperCase=(str)=>{
5758
5822
  if(nothing(str)) return false;
5759
5823
  return str[0].toUpperCase()===str[0];
5760
5824
  }
@@ -13161,7 +13225,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13161
13225
 
13162
13226
 
13163
13227
 
13164
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (17/03/2026-16:50:29)»*/
13228
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
13165
13229
  /*-----------------------------------------------------------------------------*/
13166
13230
 
13167
13231
 
@@ -14490,10 +14554,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
14490
14554
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14491
14555
 
14492
14556
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14493
- /*utils 3D library associated with aotra version : «1_29072022-2359 (17/03/2026-16:50:29)»*/
14557
+ /*utils 3D library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
14494
14558
  /*-----------------------------------------------------------------------------*/
14495
14559
 
14496
- /*utils AI library associated with aotra version : «1_29072022-2359 (17/03/2026-16:50:29)»*/
14560
+ /*utils AI library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
14497
14561
  /*-----------------------------------------------------------------------------*/
14498
14562
 
14499
14563
 
@@ -14639,7 +14703,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14639
14703
 
14640
14704
 
14641
14705
 
14642
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (17/03/2026-16:50:29)»*/
14706
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (04/04/2026-17:54:28)»*/
14643
14707
  /*-----------------------------------------------------------------------------*/
14644
14708
 
14645
14709
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1831",
3
+ "version": "0.0.1833",
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)",