@vuu-ui/vuu-utils 0.8.36 → 0.8.37

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/index.js CHANGED
@@ -28,6 +28,7 @@ var itemToString = require('./itemToString.js');
28
28
  var jsonUtils = require('./json-utils.js');
29
29
  var keyboardUtils = require('./keyboard-utils.js');
30
30
  var keyset = require('./keyset.js');
31
+ var localStorageUtils = require('./local-storage-utils.js');
31
32
  var loggingUtils = require('./logging-utils.js');
32
33
  var menuUtils = require('./menu-utils.js');
33
34
  var moduleUtils = require('./module-utils.js');
@@ -234,6 +235,9 @@ exports.PageUp = keyboardUtils.PageUp;
234
235
  exports.Space = keyboardUtils.Space;
235
236
  exports.Tab = keyboardUtils.Tab;
236
237
  exports.KeySet = keyset.KeySet;
238
+ exports.getAllLocalEntity = localStorageUtils.getAllLocalEntity;
239
+ exports.getLocalEntity = localStorageUtils.getLocalEntity;
240
+ exports.saveLocalEntity = localStorageUtils.saveLocalEntity;
237
241
  exports.getLoggingConfigForWorker = loggingUtils.getLoggingConfigForWorker;
238
242
  exports.logger = loggingUtils.logger;
239
243
  exports.isGroupMenuItemDescriptor = menuUtils.isGroupMenuItemDescriptor;
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ const getLocalEntity = (url) => {
4
+ const data = localStorage.getItem(url);
5
+ return data ? JSON.parse(data) : void 0;
6
+ };
7
+ const getAllLocalEntity = (url) => Object.entries(localStorage).filter(([key]) => key.includes(url)).map(([, value]) => JSON.parse(value));
8
+ const saveLocalEntity = (url, data) => {
9
+ try {
10
+ localStorage.setItem(url, JSON.stringify(data));
11
+ return data;
12
+ } catch {
13
+ return void 0;
14
+ }
15
+ };
16
+
17
+ exports.getAllLocalEntity = getAllLocalEntity;
18
+ exports.getLocalEntity = getLocalEntity;
19
+ exports.saveLocalEntity = saveLocalEntity;
20
+ //# sourceMappingURL=local-storage-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage-utils.js","sources":["../src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(url: string): T | undefined => {\n const data = localStorage.getItem(url);\n return data ? JSON.parse(data) : undefined;\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,CAAA;AACrC,EAAA,OAAO,IAAO,GAAA,IAAA,CAAK,KAAM,CAAA,IAAI,CAAI,GAAA,KAAA,CAAA,CAAA;AACnC,EAAA;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,EAAA;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,CAAA;AAC9C,IAAO,OAAA,IAAA,CAAA;AAAA,GACD,CAAA,MAAA;AACN,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AACF;;;;;;"}
package/esm/index.js CHANGED
@@ -26,6 +26,7 @@ export { itemToString } from './itemToString.js';
26
26
  export { jsonToDataSourceRows } from './json-utils.js';
27
27
  export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, End, Enter, Escape, Home, PageDown, PageUp, Space, Tab } from './keyboard-utils.js';
28
28
  export { KeySet } from './keyset.js';
29
+ export { getAllLocalEntity, getLocalEntity, saveLocalEntity } from './local-storage-utils.js';
29
30
  export { getLoggingConfigForWorker, logger } from './logging-utils.js';
30
31
  export { isGroupMenuItemDescriptor } from './menu-utils.js';
31
32
  export { assertModuleExportsAtLeastOneComponent, isModule } from './module-utils.js';
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,16 @@
1
+ const getLocalEntity = (url) => {
2
+ const data = localStorage.getItem(url);
3
+ return data ? JSON.parse(data) : void 0;
4
+ };
5
+ const getAllLocalEntity = (url) => Object.entries(localStorage).filter(([key]) => key.includes(url)).map(([, value]) => JSON.parse(value));
6
+ const saveLocalEntity = (url, data) => {
7
+ try {
8
+ localStorage.setItem(url, JSON.stringify(data));
9
+ return data;
10
+ } catch {
11
+ return void 0;
12
+ }
13
+ };
14
+
15
+ export { getAllLocalEntity, getLocalEntity, saveLocalEntity };
16
+ //# sourceMappingURL=local-storage-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage-utils.js","sources":["../src/local-storage-utils.ts"],"sourcesContent":["export const getLocalEntity = <T>(url: string): T | undefined => {\n const data = localStorage.getItem(url);\n return data ? JSON.parse(data) : undefined;\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,CAAA;AACrC,EAAA,OAAO,IAAO,GAAA,IAAA,CAAK,KAAM,CAAA,IAAI,CAAI,GAAA,KAAA,CAAA,CAAA;AACnC,EAAA;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,EAAA;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,CAAA;AAC9C,IAAO,OAAA,IAAA,CAAA;AAAA,GACD,CAAA,MAAA;AACN,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AACF;;;;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
- "version": "0.8.36",
2
+ "version": "0.8.37",
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.8.36",
8
- "@vuu-ui/vuu-table-types": "0.8.36",
9
- "@vuu-ui/vuu-filter-types": "0.8.36",
10
- "@vuu-ui/vuu-protocol-types": "0.8.36"
7
+ "@vuu-ui/vuu-data-types": "0.8.37",
8
+ "@vuu-ui/vuu-table-types": "0.8.37",
9
+ "@vuu-ui/vuu-filter-types": "0.8.37",
10
+ "@vuu-ui/vuu-protocol-types": "0.8.37"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "@internationalized/date": "^3.0.0",
package/types/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from "./itemToString";
22
22
  export * from "./json-utils";
23
23
  export * from "./keyboard-utils";
24
24
  export * from "./keyset";
25
+ export * from "./local-storage-utils";
25
26
  export * from "./logging-utils";
26
27
  export * from "./menu-utils";
27
28
  export * from "./module-utils";
@@ -0,0 +1,3 @@
1
+ export declare const getLocalEntity: <T>(url: string) => T | undefined;
2
+ export declare const getAllLocalEntity: <T>(url: string) => T[];
3
+ export declare const saveLocalEntity: <T>(url: string, data: T) => T | undefined;