aotrautils-srv 0.0.2015 → 0.0.2016

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/10/2026-23:02:09)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (06/10/2026-00:38:00)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5485,7 +5485,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5485
5485
 
5486
5486
 
5487
5487
 
5488
- /*utils AI library associated with aotra version : «1_29072022-2359 (05/10/2026-23:02:09)»*/
5488
+ /*utils AI library associated with aotra version : «1_29072022-2359 (06/10/2026-00:38:00)»*/
5489
5489
  /*-----------------------------------------------------------------------------*/
5490
5490
 
5491
5491
 
@@ -5749,7 +5749,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
5749
5749
 
5750
5750
 
5751
5751
 
5752
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (05/10/2026-23:02:09)»*/
5752
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (06/10/2026-00:38:00)»*/
5753
5753
  /*-----------------------------------------------------------------------------*/
5754
5754
 
5755
5755
 
@@ -7800,12 +7800,24 @@ function toConvention(type="snake",str){
7800
7800
 
7801
7801
 
7802
7802
 
7803
- function capitalize(str){
7803
+ window.capitalize=function(str){
7804
7804
  if(nothing(str)) return "";
7805
7805
  return str.replace(/(?:^|\s)\S/m, firstChar => firstChar.toUpperCase()); // We replace only the first character.
7806
+ };
7807
+
7808
+
7809
+ window.unCamelCase=function(str, forceLowerCase=true){
7810
+ if(nothing(str)) return "";
7811
+ const result=str
7812
+ .replace(/([a-z0-9])([A-Z])/g, "$1 $2") // camelCase -> camel Case
7813
+ .replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2"); // HTTPResponse -> HTTP Response
7814
+ if(forceLowerCase)
7815
+ return result.toLowerCase();
7816
+ return result;
7806
7817
  }
7807
7818
 
7808
7819
 
7820
+
7809
7821
  /* ## Utility global methods in a javascript, console (nodejs) or vanilla javascript with no browser environment.
7810
7822
  *
7811
7823
  * This set of methods gathers utility generic-purpose methods usable in any JS project.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.2015",
3
+ "version": "0.0.2016",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils-srv",
9
- "version": "0.0.2015",
9
+ "version": "0.0.2016",
10
10
  "license": "HGPL-1.0",
11
11
  "dependencies": {
12
12
  "atob": "^2.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.2015",
3
+ "version": "0.0.2016",
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)",