@vuu-ui/vuu-utils 0.13.90 → 0.13.91
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/cjs/packages/vuu-utils/src/index.js +1 -0
- package/cjs/packages/vuu-utils/src/index.js.map +1 -1
- package/cjs/packages/vuu-utils/src/local-storage-utils.js +12 -2
- package/cjs/packages/vuu-utils/src/local-storage-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/index.js +1 -1
- package/esm/packages/vuu-utils/src/local-storage-utils.js +12 -3
- package/esm/packages/vuu-utils/src/local-storage-utils.js.map +1 -1
- package/package.json +8 -8
- package/types/local-storage-utils.d.ts +2 -1
|
@@ -340,6 +340,7 @@ exports.Tab = keyboardUtils.Tab;
|
|
|
340
340
|
exports.isArrowKey = keyboardUtils.isArrowKey;
|
|
341
341
|
exports.KeySet = keyset.KeySet;
|
|
342
342
|
exports.getSelectedOption = listUtils.getSelectedOption;
|
|
343
|
+
exports.clearLocalEntity = localStorageUtils.clearLocalEntity;
|
|
343
344
|
exports.getAllLocalEntity = localStorageUtils.getAllLocalEntity;
|
|
344
345
|
exports.getLocalEntity = localStorageUtils.getLocalEntity;
|
|
345
346
|
exports.saveLocalEntity = localStorageUtils.saveLocalEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const getLocalEntity = (
|
|
4
|
-
const data = localStorage.getItem(
|
|
3
|
+
const getLocalEntity = (key) => {
|
|
4
|
+
const data = localStorage.getItem(key);
|
|
5
5
|
return data ? JSON.parse(data) : void 0;
|
|
6
6
|
};
|
|
7
|
+
const clearLocalEntity = (key) => {
|
|
8
|
+
const doomedItem = localStorage.getItem(key);
|
|
9
|
+
if (doomedItem) {
|
|
10
|
+
localStorage.removeItem(key);
|
|
11
|
+
return true;
|
|
12
|
+
} else {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
const getAllLocalEntity = (url) => Object.entries(localStorage).filter(([key]) => key.includes(url)).map(([, value]) => JSON.parse(value));
|
|
8
17
|
const saveLocalEntity = (url, data) => {
|
|
9
18
|
try {
|
|
@@ -14,6 +23,7 @@ const saveLocalEntity = (url, data) => {
|
|
|
14
23
|
}
|
|
15
24
|
};
|
|
16
25
|
|
|
26
|
+
exports.clearLocalEntity = clearLocalEntity;
|
|
17
27
|
exports.getAllLocalEntity = getAllLocalEntity;
|
|
18
28
|
exports.getLocalEntity = getLocalEntity;
|
|
19
29
|
exports.saveLocalEntity = saveLocalEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage-utils.js","sources":["../../../../../../packages/vuu-utils/src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(
|
|
1
|
+
{"version":3,"file":"local-storage-utils.js","sources":["../../../../../../packages/vuu-utils/src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(key: string): T | undefined => {\n const data = localStorage.getItem(key);\n return data ? JSON.parse(data) : undefined;\n};\n\nexport const clearLocalEntity = (key: string) => {\n const doomedItem = localStorage.getItem(key);\n if (doomedItem) {\n localStorage.removeItem(key);\n return true;\n } else {\n return false;\n }\n};\n\nexport const getAllLocalEntity = <T>(url: string): T[] =>\n Object.entries(localStorage)\n .filter(([key]) => key.includes(url))\n .map(([, value]) => JSON.parse(value) as T);\n\nexport const saveLocalEntity = <T>(url: string, data: T): T | undefined => {\n try {\n localStorage.setItem(url, JSON.stringify(data));\n return data;\n } catch {\n return undefined;\n }\n};\n"],"names":[],"mappings":";;AAAa,MAAA,cAAA,GAAiB,CAAI,GAA+B,KAAA;AAC/D,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,OAAA,CAAQ,GAAG,CAAA;AACrC,EAAA,OAAO,IAAO,GAAA,IAAA,CAAK,KAAM,CAAA,IAAI,CAAI,GAAA,KAAA,CAAA;AACnC;AAEa,MAAA,gBAAA,GAAmB,CAAC,GAAgB,KAAA;AAC/C,EAAM,MAAA,UAAA,GAAa,YAAa,CAAA,OAAA,CAAQ,GAAG,CAAA;AAC3C,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,YAAA,CAAa,WAAW,GAAG,CAAA;AAC3B,IAAO,OAAA,IAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,KAAA;AAAA;AAEX;AAEa,MAAA,iBAAA,GAAoB,CAAI,GAAA,KACnC,MAAO,CAAA,OAAA,CAAQ,YAAY,CAAA,CACxB,MAAO,CAAA,CAAC,CAAC,GAAG,CAAM,KAAA,GAAA,CAAI,SAAS,GAAG,CAAC,CACnC,CAAA,GAAA,CAAI,CAAC,GAAG,KAAK,CAAM,KAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAM;AAEjC,MAAA,eAAA,GAAkB,CAAI,GAAA,EAAa,IAA2B,KAAA;AACzE,EAAI,IAAA;AACF,IAAA,YAAA,CAAa,OAAQ,CAAA,GAAA,EAAK,IAAK,CAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AAC9C,IAAO,OAAA,IAAA;AAAA,GACD,CAAA,MAAA;AACN,IAAO,OAAA,KAAA,CAAA;AAAA;AAEX;;;;;;;"}
|
|
@@ -37,7 +37,7 @@ export { jsonToDataSourceRows } from './json-utils.js';
|
|
|
37
37
|
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, End, Enter, Escape, Home, PageDown, PageUp, Space, Tab, isArrowKey } from './keyboard-utils.js';
|
|
38
38
|
export { KeySet } from './keyset.js';
|
|
39
39
|
export { getSelectedOption } from './list-utils.js';
|
|
40
|
-
export { getAllLocalEntity, getLocalEntity, saveLocalEntity } from './local-storage-utils.js';
|
|
40
|
+
export { clearLocalEntity, getAllLocalEntity, getLocalEntity, saveLocalEntity } from './local-storage-utils.js';
|
|
41
41
|
export { getLoggingConfigForWorker, logUnhandledMessage, logger } from './logging-utils.js';
|
|
42
42
|
export { isModule } from './module-utils.js';
|
|
43
43
|
export { uuid } from './nanoid/index.js';
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
const getLocalEntity = (
|
|
2
|
-
const data = localStorage.getItem(
|
|
1
|
+
const getLocalEntity = (key) => {
|
|
2
|
+
const data = localStorage.getItem(key);
|
|
3
3
|
return data ? JSON.parse(data) : void 0;
|
|
4
4
|
};
|
|
5
|
+
const clearLocalEntity = (key) => {
|
|
6
|
+
const doomedItem = localStorage.getItem(key);
|
|
7
|
+
if (doomedItem) {
|
|
8
|
+
localStorage.removeItem(key);
|
|
9
|
+
return true;
|
|
10
|
+
} else {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
5
14
|
const getAllLocalEntity = (url) => Object.entries(localStorage).filter(([key]) => key.includes(url)).map(([, value]) => JSON.parse(value));
|
|
6
15
|
const saveLocalEntity = (url, data) => {
|
|
7
16
|
try {
|
|
@@ -12,5 +21,5 @@ const saveLocalEntity = (url, data) => {
|
|
|
12
21
|
}
|
|
13
22
|
};
|
|
14
23
|
|
|
15
|
-
export { getAllLocalEntity, getLocalEntity, saveLocalEntity };
|
|
24
|
+
export { clearLocalEntity, getAllLocalEntity, getLocalEntity, saveLocalEntity };
|
|
16
25
|
//# sourceMappingURL=local-storage-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage-utils.js","sources":["../../../../../../packages/vuu-utils/src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(
|
|
1
|
+
{"version":3,"file":"local-storage-utils.js","sources":["../../../../../../packages/vuu-utils/src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(key: string): T | undefined => {\n const data = localStorage.getItem(key);\n return data ? JSON.parse(data) : undefined;\n};\n\nexport const clearLocalEntity = (key: string) => {\n const doomedItem = localStorage.getItem(key);\n if (doomedItem) {\n localStorage.removeItem(key);\n return true;\n } else {\n return false;\n }\n};\n\nexport const getAllLocalEntity = <T>(url: string): T[] =>\n Object.entries(localStorage)\n .filter(([key]) => key.includes(url))\n .map(([, value]) => JSON.parse(value) as T);\n\nexport const saveLocalEntity = <T>(url: string, data: T): T | undefined => {\n try {\n localStorage.setItem(url, JSON.stringify(data));\n return data;\n } catch {\n return undefined;\n }\n};\n"],"names":[],"mappings":"AAAa,MAAA,cAAA,GAAiB,CAAI,GAA+B,KAAA;AAC/D,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,OAAA,CAAQ,GAAG,CAAA;AACrC,EAAA,OAAO,IAAO,GAAA,IAAA,CAAK,KAAM,CAAA,IAAI,CAAI,GAAA,KAAA,CAAA;AACnC;AAEa,MAAA,gBAAA,GAAmB,CAAC,GAAgB,KAAA;AAC/C,EAAM,MAAA,UAAA,GAAa,YAAa,CAAA,OAAA,CAAQ,GAAG,CAAA;AAC3C,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,YAAA,CAAa,WAAW,GAAG,CAAA;AAC3B,IAAO,OAAA,IAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,KAAA;AAAA;AAEX;AAEa,MAAA,iBAAA,GAAoB,CAAI,GAAA,KACnC,MAAO,CAAA,OAAA,CAAQ,YAAY,CAAA,CACxB,MAAO,CAAA,CAAC,CAAC,GAAG,CAAM,KAAA,GAAA,CAAI,SAAS,GAAG,CAAC,CACnC,CAAA,GAAA,CAAI,CAAC,GAAG,KAAK,CAAM,KAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAM;AAEjC,MAAA,eAAA,GAAkB,CAAI,GAAA,EAAa,IAA2B,KAAA;AACzE,EAAI,IAAA;AACF,IAAA,YAAA,CAAa,OAAQ,CAAA,GAAA,EAAK,IAAK,CAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AAC9C,IAAO,OAAA,IAAA;AAAA,GACD,CAAA,MAAA;AACN,IAAO,OAAA,KAAA,CAAA;AAAA;AAEX;;;;"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.91",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "0.13.
|
|
8
|
-
"@vuu-ui/vuu-table-types": "0.13.
|
|
9
|
-
"@vuu-ui/vuu-filter-types": "0.13.
|
|
10
|
-
"@vuu-ui/vuu-protocol-types": "0.13.
|
|
7
|
+
"@vuu-ui/vuu-data-types": "0.13.91",
|
|
8
|
+
"@vuu-ui/vuu-table-types": "0.13.91",
|
|
9
|
+
"@vuu-ui/vuu-filter-types": "0.13.91",
|
|
10
|
+
"@vuu-ui/vuu-protocol-types": "0.13.91"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@internationalized/date": "^3.0.0",
|
|
14
|
-
"@vuu-ui/vuu-filter-parser": "0.13.
|
|
14
|
+
"@vuu-ui/vuu-filter-parser": "0.13.91",
|
|
15
15
|
"clsx": "^2.0.0",
|
|
16
|
-
"react": "^19.2.
|
|
17
|
-
"react-dom": "^19.2.
|
|
16
|
+
"react": "^19.2.3",
|
|
17
|
+
"react-dom": "^19.2.3"
|
|
18
18
|
},
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"files": [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const getLocalEntity: <T>(
|
|
1
|
+
export declare const getLocalEntity: <T>(key: string) => T | undefined;
|
|
2
|
+
export declare const clearLocalEntity: (key: string) => boolean;
|
|
2
3
|
export declare const getAllLocalEntity: <T>(url: string) => T[];
|
|
3
4
|
export declare const saveLocalEntity: <T>(url: string, data: T) => T | undefined;
|