puvox-library 1.0.50 → 1.0.51
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.
- package/library_standard.js +8 -4
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -2890,7 +2890,8 @@ const puvox_library =
|
|
2890
2890
|
helper_read(groupName, storageType, expireSeconds = 0){
|
2891
2891
|
const appName = puvox_library.getAppName();
|
2892
2892
|
if (storageType === 'file'){
|
2893
|
-
const
|
2893
|
+
const dir = puvox_library.file.tempDir() + appName + '/';
|
2894
|
+
const filepath = dir + groupName + '.json';
|
2894
2895
|
// todo: add expiration
|
2895
2896
|
return puvox_library.file.read(filepath);
|
2896
2897
|
} else if (storageType === 'localStorage') {
|
@@ -2914,7 +2915,9 @@ const puvox_library =
|
|
2914
2915
|
content = puvox_library.isString (content) ? content : (puvox_library.isArray(content) || puvox_library.isObject(content) ? JSON.stringify(content) : content);
|
2915
2916
|
const appName = puvox_library.getAppName();
|
2916
2917
|
if (storageType === 'file'){
|
2917
|
-
const
|
2918
|
+
const dir = puvox_library.file.tempDir() + appName + '/';
|
2919
|
+
puvox_library.file.createDirectory(dir);
|
2920
|
+
const filepath = dir + groupName + '.json';
|
2918
2921
|
// todo: add expiration
|
2919
2922
|
puvox_library.file.write(filepath, content);
|
2920
2923
|
return true;
|
@@ -2934,7 +2937,7 @@ const puvox_library =
|
|
2934
2937
|
helper_delete(groupName, storageType){
|
2935
2938
|
const appName = puvox_library.getAppName();
|
2936
2939
|
if (storageType === 'file'){
|
2937
|
-
const filepath = puvox_library.file.tempDir() + appName + '
|
2940
|
+
const filepath = puvox_library.file.tempDir() + appName + '/' + groupName + '.json';
|
2938
2941
|
// todo: better delete
|
2939
2942
|
puvox_library.file.delete(filepath);
|
2940
2943
|
return true;
|
@@ -2991,7 +2994,7 @@ const puvox_library =
|
|
2991
2994
|
if (!this.customCacheDir){
|
2992
2995
|
this.customCacheDir = puvox_library.file.tempDir();
|
2993
2996
|
}
|
2994
|
-
let finaldir = puvox_library.trailingSlash(this.customCacheDir +
|
2997
|
+
let finaldir = puvox_library.trailingSlash(this.customCacheDir + puvox_library.getAppName() + '_cache_');
|
2995
2998
|
return finaldir;
|
2996
2999
|
},
|
2997
3000
|
set_dir(dir, auto_clear_seconds=null){
|
@@ -3371,6 +3374,7 @@ const puvox_library =
|
|
3371
3374
|
(object.length >= 2) &&
|
3372
3375
|
((object[0] === '{') || (object[0] === '['))
|
3373
3376
|
),
|
3377
|
+
//htmlentities
|
3374
3378
|
encode_html_entities (content) {
|
3375
3379
|
return content.replace(/[\u00A0-\u9999<>\&]/g, function(i) {
|
3376
3380
|
return '&#'+i.charCodeAt(0)+';';
|