aotrautils 0.0.1838 → 0.0.1839
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.
- aotrautils/aotrautils.build.js +46 -65
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4116,72 +4116,53 @@ window.instanciate=function(className=null){
|
|
|
4116
4116
|
// If class name is a simple array, a simple «[]» is enough :
|
|
4117
4117
|
if(className==="Array") return [];
|
|
4118
4118
|
|
|
4119
|
+
|
|
4119
4120
|
const classInWindow=window[className];
|
|
4120
|
-
|
|
4121
4121
|
if(!classInWindow){
|
|
4122
4122
|
// TRACE
|
|
4123
4123
|
lognow(`WARN : CAUTION : «${className}» class does not seem to be registered in the global window object. This can lead to problems instanciating it in a pure nodejs context.`);
|
|
4124
4124
|
}
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
try{
|
|
4128
|
-
try{
|
|
4129
|
-
newObj=Reflect.construct(classInWindow);
|
|
4130
|
-
}catch(e1){
|
|
4131
|
-
|
|
4132
|
-
// // TRACE
|
|
4133
|
-
// console.log("WARN : Could not instanciate class «"+className+"». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4134
|
-
|
|
4135
|
-
// TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4136
|
-
newObj=eval("new "+className+"();");
|
|
4137
|
-
|
|
4138
|
-
}
|
|
4139
|
-
}catch(e2){
|
|
4140
|
-
|
|
4141
|
-
// // TRACE
|
|
4142
|
-
// console.log("ERROR : Could not instanciate class «"+className+"» with eval. (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4143
|
-
|
|
4144
|
-
try{
|
|
4145
|
-
|
|
4146
|
-
// // TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4147
|
-
// newObj=eval("new window."+className+"();");
|
|
4148
|
-
|
|
4149
|
-
newObj=Reflect.construct(classInWindow);
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
}catch(e3){
|
|
4153
|
-
|
|
4154
|
-
// // TRACE
|
|
4155
|
-
// console.log("ERROR : Could not instanciate class «"+className+"» with eval and «window.». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4156
|
-
// // TRACE
|
|
4157
|
-
// console.log("ERROR : Could not instanciate class «"+className+"» with Reflect and «window.». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4158
4125
|
|
|
4159
|
-
|
|
4160
|
-
// TODO : FIXME : This is the most performance-costing fallback :
|
|
4161
|
-
try{
|
|
4162
|
-
|
|
4163
|
-
if(classInWindow){
|
|
4164
|
-
|
|
4165
|
-
newObj.__proto__=classInWindow.prototype;
|
|
4166
|
-
|
|
4167
|
-
}else{
|
|
4168
|
-
|
|
4169
|
-
// TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4170
|
-
newObj.__proto__=eval(className+".prototype");
|
|
4171
|
-
}
|
|
4172
|
-
|
|
4173
|
-
}catch(e4){
|
|
4174
|
-
|
|
4175
|
-
// // TRACE
|
|
4176
|
-
// console.log("ERROR : Could not instanciate class «"+className+"» with prototype affectation.");
|
|
4177
|
-
// console.log("ERROR : Returning plain object since all instantiation methods have failed for class «"+className+"».");
|
|
4178
|
-
|
|
4179
|
-
}
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
}
|
|
4183
|
-
}
|
|
4184
4126
|
|
|
4127
|
+
// OLD :
|
|
4128
|
+
// try{
|
|
4129
|
+
// try{
|
|
4130
|
+
// newObj=Reflect.construct(classInWindow);
|
|
4131
|
+
// }catch(e1){
|
|
4132
|
+
//// // TRACE
|
|
4133
|
+
//// console.log("WARN : Could not instanciate class «"+className+"». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4134
|
+
// // TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4135
|
+
// newObj=eval("new "+className+"();");
|
|
4136
|
+
// }
|
|
4137
|
+
// }catch(e2){
|
|
4138
|
+
//// // TRACE
|
|
4139
|
+
//// console.log("ERROR : Could not instanciate class «"+className+"» with eval. (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4140
|
+
// try{
|
|
4141
|
+
//// // TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4142
|
+
//// newObj=eval("new window."+className+"();");
|
|
4143
|
+
// newObj=Reflect.construct(classInWindow);
|
|
4144
|
+
// }catch(e3){
|
|
4145
|
+
//// // TRACE
|
|
4146
|
+
//// console.log("ERROR : Could not instanciate class «"+className+"» with eval and «window.». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4147
|
+
//// console.log("ERROR : Could not instanciate class «"+className+"» with Reflect and «window.». (Maybe class is undefined or default constructor doesn't exist !)");
|
|
4148
|
+
// // TODO : FIXME : This is the most performance-costing fallback :
|
|
4149
|
+
// try{
|
|
4150
|
+
// if(classInWindow){
|
|
4151
|
+
// newObj.__proto__=classInWindow.prototype;
|
|
4152
|
+
// }else{
|
|
4153
|
+
//
|
|
4154
|
+
// // TODO : FIXME : I don't like that at all, to use eval(...), but on today I know of no other solution... :
|
|
4155
|
+
// newObj.__proto__=eval(className+".prototype");
|
|
4156
|
+
// }
|
|
4157
|
+
// }catch(e4){
|
|
4158
|
+
//// // TRACE
|
|
4159
|
+
//// console.log("ERROR : Could not instanciate class «"+className+"» with prototype affectation.");
|
|
4160
|
+
//// console.log("ERROR : Returning plain object since all instantiation methods have failed for class «"+className+"».");
|
|
4161
|
+
// }
|
|
4162
|
+
// }
|
|
4163
|
+
// }
|
|
4164
|
+
|
|
4165
|
+
newObj=new classInWindow();
|
|
4185
4166
|
return newObj;
|
|
4186
4167
|
};
|
|
4187
4168
|
|
|
@@ -5145,7 +5126,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5145
5126
|
|
|
5146
5127
|
|
|
5147
5128
|
|
|
5148
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
5129
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
5149
5130
|
/*-----------------------------------------------------------------------------*/
|
|
5150
5131
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
5151
5132
|
*
|
|
@@ -13225,7 +13206,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
13225
13206
|
|
|
13226
13207
|
|
|
13227
13208
|
|
|
13228
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
13209
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
13229
13210
|
/*-----------------------------------------------------------------------------*/
|
|
13230
13211
|
|
|
13231
13212
|
|
|
@@ -14554,10 +14535,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14554
14535
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14555
14536
|
|
|
14556
14537
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14557
|
-
/*utils 3D library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
14538
|
+
/*utils 3D library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
14558
14539
|
/*-----------------------------------------------------------------------------*/
|
|
14559
14540
|
|
|
14560
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
14541
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
14561
14542
|
/*-----------------------------------------------------------------------------*/
|
|
14562
14543
|
|
|
14563
14544
|
|
|
@@ -14703,7 +14684,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
|
|
|
14703
14684
|
|
|
14704
14685
|
|
|
14705
14686
|
|
|
14706
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (05/04/2026-
|
|
14687
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (05/04/2026-12:31:28)»*/
|
|
14707
14688
|
/*-----------------------------------------------------------------------------*/
|
|
14708
14689
|
|
|
14709
14690
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1839",
|
|
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)",
|