aotrautils 0.0.1039 → 0.0.1041

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 (02/09/2024-03:00:28)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (08/09/2024-02:03:20)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5185,7 +5185,7 @@ JSON.recycle=function recycle($){
5185
5185
 
5186
5186
 
5187
5187
 
5188
-
5188
+ // CAUTION : TODO : FIXME WILL ERROR IF THERE IS A NON-ESCAPED SINGLE QUOTE ("'") IN RAW STRING !!!
5189
5189
  // JSON parsing management :
5190
5190
  window.parseJSON=function(strParam){
5191
5191
 
@@ -5259,7 +5259,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5259
5259
 
5260
5260
 
5261
5261
 
5262
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (02/09/2024-03:00:28)»*/
5262
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (08/09/2024-02:03:20)»*/
5263
5263
  /*-----------------------------------------------------------------------------*/
5264
5264
  /* ## Utility global methods in a browser (htmljs) client environment.
5265
5265
  *
@@ -13474,7 +13474,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13474
13474
 
13475
13475
 
13476
13476
 
13477
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (02/09/2024-03:00:28)»*/
13477
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (08/09/2024-02:03:20)»*/
13478
13478
  /*-----------------------------------------------------------------------------*/
13479
13479
 
13480
13480
 
@@ -14713,7 +14713,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14713
14713
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14714
14714
 
14715
14715
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14716
- /*utils AI library associated with aotra version : «1_29072022-2359 (02/09/2024-03:00:28)»*/
14716
+ /*utils AI library associated with aotra version : «1_29072022-2359 (08/09/2024-02:03:20)»*/
14717
14717
  /*-----------------------------------------------------------------------------*/
14718
14718
 
14719
14719
 
@@ -14857,7 +14857,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14857
14857
 
14858
14858
 
14859
14859
 
14860
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (02/09/2024-03:00:28)»*/
14860
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (08/09/2024-02:03:20)»*/
14861
14861
  /*-----------------------------------------------------------------------------*/
14862
14862
 
14863
14863
 
@@ -16581,8 +16581,8 @@ getListManager=function(config){
16581
16581
  };
16582
16582
 
16583
16583
 
16584
-
16585
- // NO : IN A NODE CONTEXT WITH requre("") WILL RESULT IN AN UNDEFINED FUNCTION ERROR !!!
16584
+ // CAUTION ! TODO : FIXME : We replace in response all single quotes with "`" (egrave) in order to avoid errors !
16585
+ // NO : IN A NODE CONTEXT WITH require("...") WILL RESULT IN AN UNDEFINED FUNCTION ERROR !!!
16586
16586
  // function performHTTPRequest(...){...
16587
16587
  // USE THIS INSTEAD :
16588
16588
  performHTTPRequest=function(completeURL,httpMethod="GET",headers={},requestBodyOrNamedArgs=null,isNodeContext=false,addCORSHeader=ADD_CORS_HEADER){
@@ -16684,11 +16684,15 @@ performHTTPRequest=function(completeURL,httpMethod="GET",headers={},requestBodyO
16684
16684
  response.on("end", () => {
16685
16685
 
16686
16686
  try{
16687
-
16688
- // DEBUG
16689
- responseDataStr=responseDataStr.replace(/'/gim,"`");
16690
-
16691
- const responseData=parseJSON(responseDataStr);
16687
+ let responseData;
16688
+ try{
16689
+ responseData=parseJSON(responseDataStr);
16690
+ }catch(error){
16691
+ // CAUTION ! TODO : FIXME : We replace in response all single quotes with "`" (egrave) in order to avoid errors !
16692
+ // DEBUG
16693
+ responseDataStr=responseDataStr.replace(/'/gim,"`");
16694
+ responseData=parseJSON(responseDataStr);
16695
+ }
16692
16696
  resolve( {responseData:responseData, response:response, responseDataStr:responseDataStr} );
16693
16697
  }catch(error){
16694
16698
  // DBG
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1039",
3
+ "version": "0.0.1041",
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)",