szld-libs 0.2.2 → 0.2.3

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.
@@ -10,3 +10,5 @@ export declare const getSessionStorage: (key: string) => any;
10
10
  export declare const removeSessionStorage: (key: string) => void;
11
11
  export declare const arrayDeduplication: (key: string, arr: any[]) => any[];
12
12
  export declare const JSONParse: (value: string) => any;
13
+ export declare function uuid(): string;
14
+ export declare const forceReload: () => void;
package/es/utils/index.js CHANGED
@@ -97,10 +97,27 @@ const JSONParse = (value) => {
97
97
  return result;
98
98
  }
99
99
  };
100
+ function uuid() {
101
+ var temp_url = URL.createObjectURL(new Blob());
102
+ var uuid2 = temp_url.toString();
103
+ URL.revokeObjectURL(temp_url);
104
+ return uuid2.substr(uuid2.lastIndexOf("/") + 1);
105
+ }
106
+ const forceReload = () => {
107
+ const key = "FORCERELOAD";
108
+ const refresh = sessionStorage.getItem(key);
109
+ if (refresh !== "1") {
110
+ sessionStorage.setItem(key, "1");
111
+ window.location.reload();
112
+ } else {
113
+ sessionStorage.removeItem(key);
114
+ }
115
+ };
100
116
  export {
101
117
  JSONParse,
102
118
  arrayDeduplication,
103
119
  filterObject,
120
+ forceReload,
104
121
  getBase64,
105
122
  getFileSuffix,
106
123
  getFileType,
@@ -109,5 +126,6 @@ export {
109
126
  removeLocalStorage,
110
127
  removeSessionStorage,
111
128
  setLocalStorage,
112
- setSessionStorage
129
+ setSessionStorage,
130
+ uuid
113
131
  };
@@ -10,3 +10,5 @@ export declare const getSessionStorage: (key: string) => any;
10
10
  export declare const removeSessionStorage: (key: string) => void;
11
11
  export declare const arrayDeduplication: (key: string, arr: any[]) => any[];
12
12
  export declare const JSONParse: (value: string) => any;
13
+ export declare function uuid(): string;
14
+ export declare const forceReload: () => void;
@@ -99,9 +99,26 @@ const JSONParse = (value) => {
99
99
  return result;
100
100
  }
101
101
  };
102
+ function uuid() {
103
+ var temp_url = URL.createObjectURL(new Blob());
104
+ var uuid2 = temp_url.toString();
105
+ URL.revokeObjectURL(temp_url);
106
+ return uuid2.substr(uuid2.lastIndexOf("/") + 1);
107
+ }
108
+ const forceReload = () => {
109
+ const key = "FORCERELOAD";
110
+ const refresh = sessionStorage.getItem(key);
111
+ if (refresh !== "1") {
112
+ sessionStorage.setItem(key, "1");
113
+ window.location.reload();
114
+ } else {
115
+ sessionStorage.removeItem(key);
116
+ }
117
+ };
102
118
  exports.JSONParse = JSONParse;
103
119
  exports.arrayDeduplication = arrayDeduplication;
104
120
  exports.filterObject = filterObject;
121
+ exports.forceReload = forceReload;
105
122
  exports.getBase64 = getBase64;
106
123
  exports.getFileSuffix = getFileSuffix;
107
124
  exports.getFileType = getFileType;
@@ -111,3 +128,4 @@ exports.removeLocalStorage = removeLocalStorage;
111
128
  exports.removeSessionStorage = removeSessionStorage;
112
129
  exports.setLocalStorage = setLocalStorage;
113
130
  exports.setSessionStorage = setSessionStorage;
131
+ exports.uuid = uuid;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",