aotrautils-srv 0.0.1829 → 0.0.1831

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:49:52)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (02/04/2026-18:03:46)»*/
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
  //================================================================
@@ -5076,7 +5140,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5076
5140
 
5077
5141
 
5078
5142
 
5079
- /*utils AI library associated with aotra version : «1_29072022-2359 (17/03/2026-16:49:52)»*/
5143
+ /*utils AI library associated with aotra version : «1_29072022-2359 (02/04/2026-18:03:46)»*/
5080
5144
  /*-----------------------------------------------------------------------------*/
5081
5145
 
5082
5146
 
@@ -5222,7 +5286,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
5222
5286
 
5223
5287
 
5224
5288
 
5225
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (17/03/2026-16:49:52)»*/
5289
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (02/04/2026-18:03:46)»*/
5226
5290
  /*-----------------------------------------------------------------------------*/
5227
5291
 
5228
5292
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1829",
3
+ "version": "0.0.1831",
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)",