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