puvox-library 1.0.74 → 1.0.75

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.
Files changed (2) hide show
  1. package/library_standard.js +26 -11
  2. package/package.json +1 -1
@@ -873,7 +873,10 @@ class PuvoxLibrary {
873
873
 
874
874
 
875
875
  datetime = new (class{
876
- MAIN_CLASS = selfMain;
876
+ MAIN_CLASS = null;
877
+ constructor(mainclass){
878
+ this.MAIN_CLASS = mainclass;
879
+ }
877
880
  // 0940 type time-ints
878
881
  isBetweenHMS(target, start, end, equality) { } // datetime, int/datetime, int/datetime, bool
879
882
  equalDays(d1,d2) {
@@ -1075,7 +1078,7 @@ class PuvoxLibrary {
1075
1078
  }
1076
1079
  return Math.floor((d2 - d1) / _MS_PER_DAY);
1077
1080
  }
1078
- })();
1081
+ })(this);
1079
1082
  // ####### END OF DATETIME FUNCTIONS ####### //
1080
1083
 
1081
1084
 
@@ -2867,8 +2870,11 @@ class PuvoxLibrary {
2867
2870
 
2868
2871
 
2869
2872
  // ######## Cookies: https://github.com/ttodua/useful-javascript/blob/master/cookies-library.js ######## //
2870
- Cookies = new (class{
2871
- MAIN_CLASS = selfMain;
2873
+ Cookies = new (class{
2874
+ MAIN_CLASS = null;
2875
+ constructor(mainclass){
2876
+ this.MAIN_CLASS = mainclass;
2877
+ }
2872
2878
  get(a,b) { return this.cookies_instance().get(a,b); }
2873
2879
  set(a,b,c) { return this.cookies_instance().set(a,b); }
2874
2880
  remove(a, b) {return this.cookies_instance().remove(a,b); }
@@ -2934,11 +2940,14 @@ class PuvoxLibrary {
2934
2940
  cookies_inited= null;
2935
2941
  // https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js
2936
2942
  cookies = function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var t={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};return function n(r,o){function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=r.write(n,t);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+c}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=t.read(c[0]);if(o[f]=r.read(u,f),e===f)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(t){return n(this.converter,e({},this.attributes,t))},withConverter:function(t){return n(e({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}(t,{path:"/"})}
2937
- })();
2943
+ })(this);
2938
2944
 
2939
2945
 
2940
2946
  cache = new (class{
2941
- MAIN_CLASS = selfMain;
2947
+ MAIN_CLASS = null;
2948
+ constructor(mainclass){
2949
+ this.MAIN_CLASS = mainclass;
2950
+ }
2942
2951
  helper_read(groupName, storageType, expireSeconds = 0){
2943
2952
  const appName = this.MAIN_CLASS.getAppName();
2944
2953
  if (storageType === 'file'){
@@ -3040,7 +3049,10 @@ class PuvoxLibrary {
3040
3049
 
3041
3050
 
3042
3051
  file = new (class {
3043
- MAIN_CLASS = selfMain;
3052
+ MAIN_CLASS = null;
3053
+ constructor(mainclass){
3054
+ this.MAIN_CLASS = mainclass;
3055
+ }
3044
3056
  // ########## CACHE DIRS (server-side JS) ##########
3045
3057
  customCacheDir = null;
3046
3058
  get_dir(){
@@ -3161,8 +3173,8 @@ class PuvoxLibrary {
3161
3173
  }
3162
3174
  return false;
3163
3175
  }
3164
- })();
3165
- })();
3176
+ })(this.MAIN_CLASS);
3177
+ })(this);
3166
3178
 
3167
3179
  // ################################################
3168
3180
  // for node packs:_fs_instance :null,
@@ -3176,7 +3188,10 @@ class PuvoxLibrary {
3176
3188
  // }
3177
3189
  // },
3178
3190
  file = new (class {
3179
- MAIN_CLASS = selfMain;
3191
+ MAIN_CLASS = null;
3192
+ constructor(mainclass){
3193
+ this.MAIN_CLASS = mainclass;
3194
+ }
3180
3195
  // support for several native modules
3181
3196
  set_module(module) {
3182
3197
  // 'fs'
@@ -3257,7 +3272,7 @@ class PuvoxLibrary {
3257
3272
  });
3258
3273
  return filesList;
3259
3274
  }
3260
- })();
3275
+ })(this);
3261
3276
 
3262
3277
  catchUnhandledExceptions (callback) {
3263
3278
  process.on('uncaughtException', (e) => { callback(e, "exc-uncaught"); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puvox-library",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "library-class-javascript",
5
5
  "main": "library_standard.js",
6
6
  "scripts": {