aotrautils-srv 0.0.1668 → 0.0.1670
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 (01/06/2025-
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (01/06/2025-03:38:15)»*/
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
5
5
|
|
6
6
|
|
@@ -3923,8 +3923,43 @@ var Timer=function(callback, delay){
|
|
3923
3923
|
|
3924
3924
|
|
3925
3925
|
|
3926
|
-
|
3927
3926
|
//=================================================================================
|
3927
|
+
// OBJECTS MANAGEMENT
|
3928
|
+
|
3929
|
+
|
3930
|
+
// (for arrays, it's index between dots !)
|
3931
|
+
window.getByDottedPath=(obj, path)=>{
|
3932
|
+
if(!contains(path,".")){
|
3933
|
+
return obj[path];
|
3934
|
+
}
|
3935
|
+
let result=obj;
|
3936
|
+
const parts=path.split(".");
|
3937
|
+
for(const part of parts) {
|
3938
|
+
if(result==null)
|
3939
|
+
return undefined;
|
3940
|
+
result=result[part];
|
3941
|
+
}
|
3942
|
+
return result;
|
3943
|
+
};
|
3944
|
+
|
3945
|
+
// (for arrays, it's index between dots !)
|
3946
|
+
window.setByDottedPath=(obj, path, value)=>{
|
3947
|
+
if(!contains(path,".")){
|
3948
|
+
obj[path]=vale;
|
3949
|
+
}
|
3950
|
+
let currentObject=obj;
|
3951
|
+
const parts=path.split(".");
|
3952
|
+
for(let i=0; i<parts.length-1; i++) {
|
3953
|
+
const part=parts[i];
|
3954
|
+
if(!(part in currentObject)) {
|
3955
|
+
const nextIsIndex=(!isNaN(parts[i + 1]));
|
3956
|
+
currentObject[part]=(nextIsIndex ? [] : {});
|
3957
|
+
}
|
3958
|
+
currentObject=currentObject[part];
|
3959
|
+
}
|
3960
|
+
currentObject[parts[parts.length - 1]]=value;
|
3961
|
+
};
|
3962
|
+
|
3928
3963
|
|
3929
3964
|
|
3930
3965
|
getUUID=function(mode=null){
|
@@ -4897,8 +4932,9 @@ window.parseJSON=function(strParam){
|
|
4897
4932
|
var obj=eval("(" + str + ")");
|
4898
4933
|
return obj;
|
4899
4934
|
} catch (error2){
|
4935
|
+
// !!! SILENT ERROR !!!
|
4900
4936
|
// TRACE
|
4901
|
-
log(error2);
|
4937
|
+
// log(error2);
|
4902
4938
|
throw new Error("ERROR : Error parsing string «" + strParam + "» as JSON. Last-chance fallback failed." +
|
4903
4939
|
" CHECK IF THERE IS ANY «'» SINGLE QUOTE CHARACTER IN YOUR LITERALS STRINGS, AND REPLACE IT WITH «´» ACUTE CHARACTER INSTEAD.");
|
4904
4940
|
}
|
@@ -4952,7 +4988,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
4952
4988
|
|
4953
4989
|
|
4954
4990
|
|
4955
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (01/06/2025-
|
4991
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (01/06/2025-03:38:15)»*/
|
4956
4992
|
/*-----------------------------------------------------------------------------*/
|
4957
4993
|
|
4958
4994
|
|
@@ -5098,7 +5134,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
|
|
5098
5134
|
|
5099
5135
|
|
5100
5136
|
|
5101
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (01/06/2025-
|
5137
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (01/06/2025-03:38:15)»*/
|
5102
5138
|
/*-----------------------------------------------------------------------------*/
|
5103
5139
|
|
5104
5140
|
|
aotrautils-srv/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "aotrautils-srv",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.1670",
|
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)",
|