@rxap/ngx-memory 21.0.1 → 22.0.0-dev.1

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 (115) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/compodoc/architecture.html +222 -0
  3. package/compodoc/changelog.html +57 -5
  4. package/compodoc/classes/MockStorage.html +114 -37
  5. package/compodoc/dependencies.html +80 -13
  6. package/compodoc/index.html +46 -5
  7. package/compodoc/injectables/EphemeralStorageService.html +107 -24
  8. package/compodoc/injectables/LocalStorageService.html +107 -24
  9. package/compodoc/injectables/SessionStorageService.html +107 -24
  10. package/compodoc/injectables/StorageService.html +96 -18
  11. package/compodoc/js/architecture-graph.js +288 -0
  12. package/compodoc/js/libs/bootstrap-native.js +4 -2
  13. package/compodoc/js/libs/jszip.min.js +13 -0
  14. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  15. package/compodoc/js/libs/tablesort.min.js +3 -3
  16. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  17. package/compodoc/js/libs/vis-network.min.js +78 -0
  18. package/compodoc/js/menu-wc.js +25 -12
  19. package/compodoc/js/menu.js +10 -11
  20. package/compodoc/js/routes/routes_index.js +1 -0
  21. package/compodoc/js/routes.js +142 -34
  22. package/compodoc/js/search/search-lunr.js +6 -8
  23. package/compodoc/js/search/search.js +118 -66
  24. package/compodoc/js/search/search_index.js +2 -2
  25. package/compodoc/js/tabs.js +98 -15
  26. package/compodoc/js/tree.js +44 -7
  27. package/compodoc/license.html +48 -6
  28. package/compodoc/llms.txt +106 -0
  29. package/compodoc/miscellaneous/functions.html +75 -23
  30. package/compodoc/miscellaneous/typealiases.html +46 -4
  31. package/compodoc/miscellaneous/variables.html +58 -5
  32. package/compodoc/modules.html +44 -3
  33. package/compodoc/overview.html +54 -3
  34. package/compodoc/properties.html +45 -4
  35. package/compodoc/routes.html +227 -0
  36. package/compodoc/styles/compodoc.css +365 -44
  37. package/compodoc/styles/dark.css +16 -0
  38. package/compodoc/template-playground/default-templates.json +192 -0
  39. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  40. package/compodoc/template-playground/main.ts +9 -0
  41. package/compodoc/template-playground/template-editor.service.ts +173 -0
  42. package/compodoc/template-playground/template-playground.component.ts +614 -0
  43. package/compodoc/template-playground/template-playground.module.ts +29 -0
  44. package/compodoc/template-playground/zip-export.service.ts +86 -0
  45. package/compodoc/template-playground-app/app.js +1389 -0
  46. package/compodoc/template-playground-app/index.html +462 -0
  47. package/compodoc/todo.html +45 -60
  48. package/docs/documentation.json +490 -415
  49. package/docs/html/assets/highlight.css +1 -1
  50. package/docs/html/assets/icons.js +1 -1
  51. package/docs/html/assets/icons.svg +1 -1
  52. package/docs/html/assets/main.js +5 -5
  53. package/docs/html/assets/search.js +1 -1
  54. package/docs/html/assets/style.css +265 -228
  55. package/docs/html/classes/EphemeralStorageService.html +151 -9
  56. package/docs/html/classes/LocalStorageService.html +151 -9
  57. package/docs/html/classes/MockStorage.html +185 -15
  58. package/docs/html/classes/SessionStorageService.html +151 -9
  59. package/docs/html/classes/StorageService.html +151 -9
  60. package/docs/html/functions/LocalStorage.html +52 -5
  61. package/docs/html/functions/SessionStorage.html +52 -5
  62. package/docs/html/functions/StorageGet.html +43 -1
  63. package/docs/html/functions/StorageHas.html +43 -1
  64. package/docs/html/functions/StorageKey.html +43 -1
  65. package/docs/html/functions/StorageRemove.html +43 -1
  66. package/docs/html/functions/StorageSet.html +46 -1
  67. package/docs/html/functions/WebStorage.html +45 -1
  68. package/docs/html/functions/getExpired.html +43 -1
  69. package/docs/html/functions/stringify.html +42 -1
  70. package/docs/html/hierarchy.html +35 -1
  71. package/docs/html/index.html +40 -4
  72. package/docs/html/modules.html +48 -1
  73. package/docs/html/types/ExpiredUnit.html +35 -2
  74. package/docs/html/variables/isBrowser.html +35 -2
  75. package/docs/markdown/README.md +1 -1
  76. package/docs/markdown/classes/EphemeralStorageService.md +17 -17
  77. package/docs/markdown/classes/LocalStorageService.md +17 -17
  78. package/docs/markdown/classes/MockStorage.md +22 -22
  79. package/docs/markdown/classes/SessionStorageService.md +17 -17
  80. package/docs/markdown/classes/StorageService.md +18 -18
  81. package/docs/markdown/functions/LocalStorage.md +4 -18
  82. package/docs/markdown/functions/SessionStorage.md +4 -18
  83. package/docs/markdown/functions/StorageGet.md +3 -3
  84. package/docs/markdown/functions/StorageHas.md +3 -3
  85. package/docs/markdown/functions/StorageKey.md +5 -5
  86. package/docs/markdown/functions/StorageRemove.md +3 -3
  87. package/docs/markdown/functions/StorageSet.md +6 -6
  88. package/docs/markdown/functions/WebStorage.md +5 -19
  89. package/docs/markdown/functions/getExpired.md +2 -2
  90. package/docs/markdown/functions/stringify.md +2 -2
  91. package/docs/markdown/globals.md +2 -2
  92. package/docs/markdown/type-aliases/ExpiredUnit.md +3 -3
  93. package/docs/markdown/variables/isBrowser.md +2 -2
  94. package/docs/wiki/Class.EphemeralStorageService.md +16 -16
  95. package/docs/wiki/Class.LocalStorageService.md +16 -16
  96. package/docs/wiki/Class.MockStorage.md +21 -21
  97. package/docs/wiki/Class.SessionStorageService.md +16 -16
  98. package/docs/wiki/Class.StorageService.md +17 -17
  99. package/docs/wiki/Function.LocalStorage.md +3 -17
  100. package/docs/wiki/Function.SessionStorage.md +3 -17
  101. package/docs/wiki/Function.StorageGet.md +2 -2
  102. package/docs/wiki/Function.StorageHas.md +2 -2
  103. package/docs/wiki/Function.StorageKey.md +4 -4
  104. package/docs/wiki/Function.StorageRemove.md +2 -2
  105. package/docs/wiki/Function.StorageSet.md +5 -5
  106. package/docs/wiki/Function.WebStorage.md +4 -18
  107. package/docs/wiki/Function.getExpired.md +1 -1
  108. package/docs/wiki/Function.stringify.md +1 -1
  109. package/docs/wiki/TypeAlias.ExpiredUnit.md +2 -2
  110. package/docs/wiki/Variable.isBrowser.md +1 -1
  111. package/docs/wiki/globals.md +1 -1
  112. package/fesm2022/rxap-ngx-memory.mjs +260 -258
  113. package/fesm2022/rxap-ngx-memory.mjs.map +1 -1
  114. package/package.json +6 -6
  115. package/types/rxap-ngx-memory.d.ts +53 -61
@@ -1,277 +1,279 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable } from '@angular/core';
3
-
4
- /**
5
- * Determining if an Angular application is rendered in the browser
6
- * The Angular `PLATFORM_ID` identifier cannot be used directly by the `decorator`.
7
- * The advantage of this is that it also works well when the server populates the Document itself.
8
- */
9
- const isBrowser = typeof document === 'object' && !!document;
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable } from "@angular/core";
3
+ const isBrowser = typeof document === "object" && !!document;
10
4
  function StorageGet(storage, key) {
11
- if (storage === null) {
12
- return null;
13
- }
14
- const value = parse(storage.getItem(key) ?? 'null') ?? null;
15
- if (value === null) {
16
- return null;
17
- }
18
- if (typeof value === 'object' && typeof value._expired !== 'undefined' && value._expired !== 0 && +new Date() >
19
- value._expired) {
20
- StorageRemove(storage, key);
21
- return null;
22
- }
23
- return value._value ?? null;
5
+ if (storage === null) return null;
6
+ const value = parse(storage.getItem(key) ?? "null") ?? null;
7
+ if (value === null) return null;
8
+ if (typeof value === "object" && typeof value._expired !== "undefined" && value._expired !== 0 && +/* @__PURE__ */ new Date() > value._expired) {
9
+ StorageRemove(storage, key);
10
+ return null;
11
+ }
12
+ return value._value ?? null;
24
13
  }
25
14
  function StorageHas(storage, key) {
26
- if (storage === null) {
27
- return false;
28
- }
29
- return storage.getItem(key) !== null;
15
+ if (storage === null) return false;
16
+ return storage.getItem(key) !== null;
30
17
  }
31
- function StorageSet(storage, key, value, expiredAt = 0, expiredUnit = 't') {
32
- if (storage === null) {
33
- return;
34
- }
35
- storage.setItem(key, stringify({
36
- _expired: getExpired(expiredAt, expiredUnit),
37
- _value: value,
38
- }));
18
+ function StorageSet(storage, key, value, expiredAt = 0, expiredUnit = "t") {
19
+ if (storage === null) return;
20
+ storage.setItem(key, stringify({
21
+ _expired: getExpired(expiredAt, expiredUnit),
22
+ _value: value
23
+ }));
39
24
  }
40
25
  function StorageRemove(storage, key) {
41
- if (storage === null) {
42
- return;
43
- }
44
- storage.removeItem(key);
26
+ if (storage === null) return;
27
+ storage.removeItem(key);
45
28
  }
46
29
  function StorageKey(storage, index) {
47
- if (storage === null) {
48
- return null;
49
- }
50
- return storage.key(index);
30
+ if (storage === null) return null;
31
+ return storage.key(index);
51
32
  }
52
33
  function getExpired(val, unit) {
53
- if (val <= 0) {
54
- return 0;
55
- }
56
- const now = +new Date();
57
- switch (unit) {
58
- case 's': // second
59
- return now + 1000 * val;
60
- case 'm': // minute
61
- return now + 1000 * 60 * val;
62
- case 'h': // hour
63
- return now + 1000 * 60 * 60 * val;
64
- case 'd': // day
65
- return now + 1000 * 60 * 60 * 24 * val;
66
- case 'w': // week
67
- return now + 1000 * 60 * 60 * 24 * 7 * val;
68
- case 'y': // year
69
- return now + 1000 * 60 * 60 * 24 * 365 * val;
70
- case 't': // customisation
71
- return now + val;
72
- default:
73
- throw new Error('Invalid expired unit');
74
- }
75
- return 0;
34
+ if (val <= 0) return 0;
35
+ const now = +/* @__PURE__ */ new Date();
36
+ switch (unit) {
37
+ case "s": return now + 1e3 * val;
38
+ case "m": return now + 6e4 * val;
39
+ case "h": return now + 36e5 * val;
40
+ case "d": return now + 864e5 * val;
41
+ case "w": return now + 6048e5 * val;
42
+ case "y": return now + 31536e6 * val;
43
+ case "t": return now + val;
44
+ default: throw new Error("Invalid expired unit");
45
+ }
46
+ return 0;
76
47
  }
77
48
  function stringify(value) {
78
- return JSON.stringify(value);
49
+ return JSON.stringify(value);
79
50
  }
80
51
  function parse(text) {
81
- try {
82
- return JSON.parse(text) ?? null;
83
- }
84
- catch (e) {
85
- return text;
86
- }
52
+ try {
53
+ return JSON.parse(text) ?? null;
54
+ } catch (e) {
55
+ return text;
56
+ }
87
57
  }
88
- class MockStorage {
89
- constructor() {
90
- this.cache = {};
91
- }
92
- get length() {
93
- return Object.keys(this.cache).length;
94
- }
95
- getItem(key) {
96
- return this.cache[key] ?? null;
97
- }
98
- key(index) {
99
- return Object.keys(this.cache)[index] ?? null;
100
- }
101
- removeItem(key) {
102
- if (this.cache[key] !== undefined) {
103
- delete this.cache[key];
104
- }
105
- }
106
- setItem(key, value) {
107
- this.cache[key] = value;
108
- }
109
- clear() {
110
- this.cache = {};
111
- }
58
+ var MockStorage = class {
59
+ constructor() {
60
+ this.cache = {};
61
+ }
62
+ get length() {
63
+ return Object.keys(this.cache).length;
64
+ }
65
+ getItem(key) {
66
+ return this.cache[key] ?? null;
67
+ }
68
+ key(index) {
69
+ return Object.keys(this.cache)[index] ?? null;
70
+ }
71
+ removeItem(key) {
72
+ if (this.cache[key] !== void 0) delete this.cache[key];
73
+ }
74
+ setItem(key, value) {
75
+ this.cache[key] = value;
76
+ }
77
+ clear() {
78
+ this.cache = {};
79
+ }
80
+ };
81
+ function WebStorage(storage, key, expiredAt = 0, expiredUnit = "d") {
82
+ return (target, propertyName) => {
83
+ const storageKey = key ?? propertyName;
84
+ let propertyValue = void 0;
85
+ Object.defineProperty(target, propertyName, {
86
+ get: () => {
87
+ if (propertyValue === void 0) {
88
+ if (StorageHas(storage, storageKey)) return propertyValue = StorageGet(storage, storageKey);
89
+ }
90
+ return propertyValue;
91
+ },
92
+ set: (value) => {
93
+ if (propertyValue === void 0) {
94
+ if (StorageHas(storage, storageKey)) {
95
+ propertyValue = StorageGet(storage, storageKey);
96
+ return;
97
+ }
98
+ }
99
+ propertyValue = value;
100
+ if (propertyValue === void 0) {
101
+ if (StorageHas(storage, storageKey)) StorageRemove(storage, storageKey);
102
+ } else StorageSet(storage, storageKey, value, expiredAt, expiredUnit);
103
+ },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ };
112
108
  }
113
-
114
- /**
115
- * @internal
116
- * @param storage
117
- * @param key
118
- * @param expiredAt
119
- * @param expiredUnit
120
- */
121
- function WebStorage(storage, key, expiredAt = 0, expiredUnit = 'd') {
122
- return (target, propertyName) => {
123
- const storageKey = key ?? propertyName;
124
- let propertyValue = undefined;
125
- Object.defineProperty(target, propertyName, {
126
- get: () => {
127
- // check if the value is set
128
- if (propertyValue === undefined) {
129
- // if not check if the value is set in the storage
130
- if (StorageHas(storage, storageKey)) {
131
- return propertyValue = StorageGet(storage, storageKey);
132
- }
133
- }
134
- return propertyValue;
135
- },
136
- set: (value) => {
137
- // check if the value is set
138
- if (propertyValue === undefined) {
139
- // if not check if the value is set in the storage
140
- if (StorageHas(storage, storageKey)) {
141
- // if yes, get the value from the storage
142
- propertyValue = StorageGet(storage, storageKey);
143
- return;
144
- }
145
- }
146
- propertyValue = value;
147
- // check if the value is set
148
- if (propertyValue === undefined) {
149
- // check if the value is set in the storage
150
- if (StorageHas(storage, storageKey)) {
151
- // remove any value from the storage
152
- StorageRemove(storage, storageKey);
153
- }
154
- }
155
- else {
156
- // set the value in the storage
157
- StorageSet(storage, storageKey, value, expiredAt, expiredUnit);
158
- }
159
- },
160
- enumerable: true,
161
- configurable: true,
162
- });
163
- };
109
+ function LocalStorage(key, expiredAt = 0, expiredUnit = "t") {
110
+ return WebStorage(isBrowser ? localStorage : null, key, expiredAt, expiredUnit);
164
111
  }
165
-
166
- /**
167
- * `localStorage` Decorator
168
- *
169
- * @param [key] Storage key
170
- * @param [expiredAt=0] Expiration time, 0 means forever
171
- * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])
172
- */
173
- function LocalStorage(key, expiredAt = 0, expiredUnit = 't') {
174
- return WebStorage(isBrowser ? localStorage : null, key, expiredAt, expiredUnit);
175
- }
176
-
177
- /**
178
- * `sessionStorage` Decorator
179
- *
180
- * @param [key] Storage key
181
- * @param [expiredAt=0] Expiration time, 0 means forever
182
- * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])
183
- */
184
- function SessionStorage(key, expiredAt = 0, expiredUnit = 't') {
185
- return WebStorage(isBrowser ? sessionStorage : null, key, expiredAt, expiredUnit);
186
- }
187
-
188
- class StorageService {
189
- constructor(storage) {
190
- this.storage = storage;
191
- }
192
- has(key) {
193
- return StorageHas(this.storage, key);
194
- }
195
- get(key) {
196
- return StorageGet(this.storage, key);
197
- }
198
- set(key, value, expiredAt = 0, expiredUnit = 'd') {
199
- return StorageSet(this.storage, key, value, expiredAt, expiredUnit);
200
- }
201
- /**
202
- * Removes the specified key, e.g.:
203
- * - `remove('key')` Remove `key` key
204
- * - `remove(/BMap_\w+/)` Bulk delete all keys starting with BMap_
205
- * @param key key name or regular expression
206
- */
207
- remove(key) {
208
- if (typeof key === 'string') {
209
- StorageRemove(this.storage, key);
210
- return;
211
- }
212
- let index = 0;
213
- let next = StorageKey(this.storage, index);
214
- const ls = [];
215
- while (next) {
216
- if (key.test(next)) {
217
- ls.push(next);
218
- }
219
- next = StorageKey(this.storage, ++index);
220
- }
221
- ls.forEach((v) => StorageRemove(this.storage, v));
222
- }
223
- clear() {
224
- this.storage?.clear();
225
- }
226
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StorageService, deps: [{ token: Storage }], target: i0.ɵɵFactoryTarget.Injectable }); }
227
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StorageService }); }
228
- }
229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StorageService, decorators: [{
230
- type: Injectable
231
- }], ctorParameters: () => [{ type: Storage }] });
232
-
233
- class EphemeralStorageService extends StorageService {
234
- constructor() {
235
- super(new MockStorage());
236
- }
237
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EphemeralStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
238
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EphemeralStorageService, providedIn: 'root' }); }
112
+ function SessionStorage(key, expiredAt = 0, expiredUnit = "t") {
113
+ return WebStorage(isBrowser ? sessionStorage : null, key, expiredAt, expiredUnit);
239
114
  }
240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EphemeralStorageService, decorators: [{
241
- type: Injectable,
242
- args: [{ providedIn: 'root' }]
243
- }], ctorParameters: () => [] });
244
-
245
- class LocalStorageService extends StorageService {
246
- constructor() {
247
- super(isBrowser ? localStorage : null);
248
- }
249
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
250
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
251
- }
252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LocalStorageService, decorators: [{
253
- type: Injectable,
254
- args: [{ providedIn: 'root' }]
255
- }], ctorParameters: () => [] });
256
-
257
- class SessionStorageService extends StorageService {
258
- constructor() {
259
- super(isBrowser ? sessionStorage : null);
260
- }
261
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
262
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SessionStorageService, providedIn: 'root' }); }
263
- }
264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SessionStorageService, decorators: [{
265
- type: Injectable,
266
- args: [{ providedIn: 'root' }]
267
- }], ctorParameters: () => [] });
268
-
269
- // region decorators
270
- // endregion
271
-
272
- /**
273
- * Generated bundle index. Do not edit.
274
- */
275
-
115
+ var StorageService = class StorageService {
116
+ constructor(storage) {
117
+ this.storage = storage;
118
+ }
119
+ has(key) {
120
+ return StorageHas(this.storage, key);
121
+ }
122
+ get(key) {
123
+ return StorageGet(this.storage, key);
124
+ }
125
+ set(key, value, expiredAt = 0, expiredUnit = "d") {
126
+ return StorageSet(this.storage, key, value, expiredAt, expiredUnit);
127
+ }
128
+ remove(key) {
129
+ if (typeof key === "string") {
130
+ StorageRemove(this.storage, key);
131
+ return;
132
+ }
133
+ let index = 0;
134
+ let next = StorageKey(this.storage, index);
135
+ const ls = [];
136
+ while (next) {
137
+ if (key.test(next)) ls.push(next);
138
+ next = StorageKey(this.storage, ++index);
139
+ }
140
+ ls.forEach((v) => StorageRemove(this.storage, v));
141
+ }
142
+ clear() {
143
+ this.storage?.clear();
144
+ }
145
+ static {
146
+ this.ɵfac = i0.ɵɵngDeclareFactory({
147
+ minVersion: "12.0.0",
148
+ version: "22.3.0",
149
+ ngImport: i0,
150
+ type: StorageService,
151
+ deps: [{ token: Storage }],
152
+ target: i0.ɵɵFactoryTarget.Injectable
153
+ });
154
+ }
155
+ static {
156
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
157
+ minVersion: "12.0.0",
158
+ version: "22.3.0",
159
+ ngImport: i0,
160
+ type: StorageService
161
+ });
162
+ }
163
+ };
164
+ i0.ɵɵngDeclareClassMetadata({
165
+ minVersion: "12.0.0",
166
+ version: "22.3.0",
167
+ ngImport: i0,
168
+ type: StorageService,
169
+ decorators: [{ type: Injectable }],
170
+ ctorParameters: () => [{ type: Storage }]
171
+ });
172
+ var EphemeralStorageService = class EphemeralStorageService extends StorageService {
173
+ constructor() {
174
+ super(new MockStorage());
175
+ }
176
+ static {
177
+ this.ɵfac = i0.ɵɵngDeclareFactory({
178
+ minVersion: "12.0.0",
179
+ version: "22.3.0",
180
+ ngImport: i0,
181
+ type: EphemeralStorageService,
182
+ deps: [],
183
+ target: i0.ɵɵFactoryTarget.Injectable
184
+ });
185
+ }
186
+ static {
187
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
188
+ minVersion: "12.0.0",
189
+ version: "22.3.0",
190
+ ngImport: i0,
191
+ type: EphemeralStorageService,
192
+ providedIn: "root"
193
+ });
194
+ }
195
+ };
196
+ i0.ɵɵngDeclareClassMetadata({
197
+ minVersion: "12.0.0",
198
+ version: "22.3.0",
199
+ ngImport: i0,
200
+ type: EphemeralStorageService,
201
+ decorators: [{
202
+ type: Injectable,
203
+ args: [{ providedIn: "root" }]
204
+ }],
205
+ ctorParameters: () => []
206
+ });
207
+ var LocalStorageService = class LocalStorageService extends StorageService {
208
+ constructor() {
209
+ super(isBrowser ? localStorage : null);
210
+ }
211
+ static {
212
+ this.ɵfac = i0.ɵɵngDeclareFactory({
213
+ minVersion: "12.0.0",
214
+ version: "22.3.0",
215
+ ngImport: i0,
216
+ type: LocalStorageService,
217
+ deps: [],
218
+ target: i0.ɵɵFactoryTarget.Injectable
219
+ });
220
+ }
221
+ static {
222
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
223
+ minVersion: "12.0.0",
224
+ version: "22.3.0",
225
+ ngImport: i0,
226
+ type: LocalStorageService,
227
+ providedIn: "root"
228
+ });
229
+ }
230
+ };
231
+ i0.ɵɵngDeclareClassMetadata({
232
+ minVersion: "12.0.0",
233
+ version: "22.3.0",
234
+ ngImport: i0,
235
+ type: LocalStorageService,
236
+ decorators: [{
237
+ type: Injectable,
238
+ args: [{ providedIn: "root" }]
239
+ }],
240
+ ctorParameters: () => []
241
+ });
242
+ var SessionStorageService = class SessionStorageService extends StorageService {
243
+ constructor() {
244
+ super(isBrowser ? sessionStorage : null);
245
+ }
246
+ static {
247
+ this.ɵfac = i0.ɵɵngDeclareFactory({
248
+ minVersion: "12.0.0",
249
+ version: "22.3.0",
250
+ ngImport: i0,
251
+ type: SessionStorageService,
252
+ deps: [],
253
+ target: i0.ɵɵFactoryTarget.Injectable
254
+ });
255
+ }
256
+ static {
257
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
258
+ minVersion: "12.0.0",
259
+ version: "22.3.0",
260
+ ngImport: i0,
261
+ type: SessionStorageService,
262
+ providedIn: "root"
263
+ });
264
+ }
265
+ };
266
+ i0.ɵɵngDeclareClassMetadata({
267
+ minVersion: "12.0.0",
268
+ version: "22.3.0",
269
+ ngImport: i0,
270
+ type: SessionStorageService,
271
+ decorators: [{
272
+ type: Injectable,
273
+ args: [{ providedIn: "root" }]
274
+ }],
275
+ ctorParameters: () => []
276
+ });
276
277
  export { EphemeralStorageService, LocalStorage, LocalStorageService, MockStorage, SessionStorage, SessionStorageService, StorageGet, StorageHas, StorageKey, StorageRemove, StorageService, StorageSet, WebStorage, getExpired, isBrowser, stringify };
277
- //# sourceMappingURL=rxap-ngx-memory.mjs.map
278
+
279
+ //# sourceMappingURL=rxap-ngx-memory.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-ngx-memory.mjs","sources":["../../../../../packages/angular/memory/src/lib/storage-utility.ts","../../../../../packages/angular/memory/src/lib/decorators/web-storage.ts","../../../../../packages/angular/memory/src/lib/decorators/local-storage.ts","../../../../../packages/angular/memory/src/lib/decorators/session-storage.ts","../../../../../packages/angular/memory/src/lib/storage.service.ts","../../../../../packages/angular/memory/src/lib/ephemeral-storage.service.ts","../../../../../packages/angular/memory/src/lib/local-storage.service.ts","../../../../../packages/angular/memory/src/lib/session-storage.service.ts","../../../../../packages/angular/memory/src/index.ts","../../../../../packages/angular/memory/src/rxap-ngx-memory.ts"],"sourcesContent":["/**\n * Expiration time unit\n * s: seconds\n * m: minute\n * h: hour\n * d: day\n * w: week\n * y: year\n * t: Custom (millisecond)\n */\nexport type ExpiredUnit = 's' | 'm' | 'h' | 'd' | 'w' | 'y' | 't';\n\n/**\n * Determining if an Angular application is rendered in the browser\n * The Angular `PLATFORM_ID` identifier cannot be used directly by the `decorator`.\n * The advantage of this is that it also works well when the server populates the Document itself.\n */\nexport const isBrowser = typeof document === 'object' && !!document;\n\nexport function StorageGet(storage: Storage | null, key: string): unknown {\n if (storage === null) {\n return null;\n }\n const value = parse(storage.getItem(key) ?? 'null') ?? null;\n if (value === null) {\n return null;\n }\n if (typeof value === 'object' && typeof value._expired !== 'undefined' && value._expired !== 0 && +new Date() >\n value._expired) {\n StorageRemove(storage, key);\n return null;\n }\n\n return value._value ?? null;\n}\n\nexport function StorageHas(storage: Storage | null, key: string): boolean {\n if (storage === null) {\n return false;\n }\n return storage.getItem(key) !== null;\n}\n\nexport function StorageSet(\n storage: Storage | null, key: string, value: any, expiredAt = 0, expiredUnit: ExpiredUnit = 't'): void {\n if (storage === null) {\n return;\n }\n storage.setItem(\n key,\n stringify({\n _expired: getExpired(expiredAt, expiredUnit),\n _value: value,\n }),\n );\n}\n\nexport function StorageRemove(storage: Storage | null, key: string): void {\n if (storage === null) {\n return;\n }\n storage.removeItem(key);\n}\n\nexport function StorageKey(storage: Storage | null, index: number): string | null {\n if (storage === null) {\n return null;\n }\n return storage.key(index);\n}\n\nexport function getExpired(val: number, unit: ExpiredUnit): number {\n if (val <= 0) {\n return 0;\n }\n const now = +new Date();\n switch (unit) {\n case 's': // second\n return now + 1000 * val;\n case 'm': // minute\n return now + 1000 * 60 * val;\n case 'h': // hour\n return now + 1000 * 60 * 60 * val;\n case 'd': // day\n return now + 1000 * 60 * 60 * 24 * val;\n case 'w': // week\n return now + 1000 * 60 * 60 * 24 * 7 * val;\n case 'y': // year\n return now + 1000 * 60 * 60 * 24 * 365 * val;\n case 't': // customisation\n return now + val;\n default:\n throw new Error('Invalid expired unit');\n }\n return 0;\n}\n\nexport function stringify(value: any): string {\n return JSON.stringify(value);\n}\n\nfunction parse(text: string): any {\n try {\n return JSON.parse(text) ?? null;\n } catch (e) {\n return text;\n }\n}\n\nexport class MockStorage implements Storage {\n\n cache: Record<string, string> = {};\n\n get length(): number {\n return Object.keys(this.cache).length;\n }\n\n getItem(key: string): string | null {\n return this.cache[key] ?? null;\n }\n\n key(index: number): string | null {\n return Object.keys(this.cache)[index] ?? null;\n }\n\n removeItem(key: string): void {\n if (this.cache[key] !== undefined) {\n delete this.cache[key];\n }\n }\n\n setItem(key: string, value: string): void {\n this.cache[key] = value;\n }\n\n clear(): void {\n this.cache = {};\n }\n\n}\n","import {\n ExpiredUnit,\n StorageGet,\n StorageHas,\n StorageRemove,\n StorageSet,\n} from '../storage-utility';\n\n/**\n * @internal\n * @param storage\n * @param key\n * @param expiredAt\n * @param expiredUnit\n */\nexport function WebStorage(\n storage: Storage | null,\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 'd',\n) {\n return (target: any, propertyName: string): void => {\n const storageKey = key ?? propertyName;\n let propertyValue: unknown | undefined = undefined;\n Object.defineProperty(target, propertyName, {\n get: () => {\n // check if the value is set\n if (propertyValue === undefined) {\n // if not check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n return propertyValue = StorageGet(storage, storageKey);\n }\n }\n return propertyValue;\n },\n set: (value: unknown) => {\n // check if the value is set\n if (propertyValue === undefined) {\n // if not check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n // if yes, get the value from the storage\n propertyValue = StorageGet(storage, storageKey);\n return;\n }\n }\n propertyValue = value;\n // check if the value is set\n if (propertyValue === undefined) {\n // check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n // remove any value from the storage\n StorageRemove(storage, storageKey);\n }\n } else {\n // set the value in the storage\n StorageSet(storage, storageKey, value, expiredAt, expiredUnit);\n }\n },\n enumerable: true,\n configurable: true,\n });\n };\n}\n","import {\n ExpiredUnit,\n isBrowser,\n} from '../storage-utility';\nimport { WebStorage } from './web-storage';\n\n/**\n * `localStorage` Decorator\n *\n * @param [key] Storage key\n * @param [expiredAt=0] Expiration time, 0 means forever\n * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])\n */\nexport function LocalStorage(\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 't',\n) {\n return WebStorage(isBrowser ? localStorage : null, key, expiredAt, expiredUnit);\n}\n","import {\n ExpiredUnit,\n isBrowser,\n} from '../storage-utility';\nimport { WebStorage } from './web-storage';\n\n/**\n * `sessionStorage` Decorator\n *\n * @param [key] Storage key\n * @param [expiredAt=0] Expiration time, 0 means forever\n * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])\n */\nexport function SessionStorage(\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 't',\n) {\n return WebStorage(isBrowser ? sessionStorage : null, key, expiredAt, expiredUnit);\n}\n","import { Injectable } from '@angular/core';\nimport {\n ExpiredUnit,\n StorageGet,\n StorageHas,\n StorageKey,\n StorageRemove,\n StorageSet,\n} from './storage-utility';\n\n@Injectable()\nexport abstract class StorageService {\n protected constructor(private storage: Storage | null) {}\n\n has(key: string): boolean {\n return StorageHas(this.storage, key);\n }\n\n get(key: string): any {\n return StorageGet(this.storage, key);\n }\n\n set(key: string, value: any, expiredAt = 0, expiredUnit: ExpiredUnit = 'd'): void {\n return StorageSet(this.storage, key, value, expiredAt, expiredUnit);\n }\n\n /**\n * Removes the specified key, e.g.:\n * - `remove('key')` Remove `key` key\n * - `remove(/BMap_\\w+/)` Bulk delete all keys starting with BMap_\n * @param key key name or regular expression\n */\n remove(key: string | RegExp): void {\n if (typeof key === 'string') {\n StorageRemove(this.storage, key);\n return;\n }\n let index = 0;\n let next = StorageKey(this.storage, index);\n const ls: string[] = [];\n while (next) {\n if (key.test(next)) {\n ls.push(next);\n }\n next = StorageKey(this.storage, ++index);\n }\n ls.forEach((v) => StorageRemove(this.storage, v));\n }\n\n clear(): void {\n this.storage?.clear();\n }\n}\n\n","import { Injectable } from '@angular/core';\nimport { MockStorage } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class EphemeralStorageService extends StorageService {\n\n constructor() {\n super(new MockStorage());\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { isBrowser } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalStorageService extends StorageService {\n constructor() {\n super(isBrowser ? localStorage : null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { isBrowser } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class SessionStorageService extends StorageService {\n constructor() {\n super(isBrowser ? sessionStorage : null);\n }\n}\n","// region decorators\nexport * from './lib/decorators/local-storage';\nexport * from './lib/decorators/session-storage';\nexport * from './lib/decorators/web-storage';\n// endregion\n\n// region \nexport * from './lib/ephemeral-storage.service';\nexport * from './lib/local-storage.service';\nexport * from './lib/session-storage.service';\nexport * from './lib/storage-utility';\nexport * from './lib/storage.service';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAYA;;;;AAIG;AACI,MAAM,SAAS,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC;AAErD,SAAU,UAAU,CAAC,OAAuB,EAAE,GAAW,EAAA;AAC7D,IAAA,IAAI,OAAO,KAAK,IAAI,EAAE;AACpB,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI;AAC3D,IAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAClB,QAAA,OAAO,IAAI;IACb;IACA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,WAAW,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;QACzG,KAAK,CAAC,QAAQ,EAAE;AAClB,QAAA,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC;AAC3B,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI;AAC7B;AAEM,SAAU,UAAU,CAAC,OAAuB,EAAE,GAAW,EAAA;AAC7D,IAAA,IAAI,OAAO,KAAK,IAAI,EAAE;AACpB,QAAA,OAAO,KAAK;IACd;IACA,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI;AACtC;AAEM,SAAU,UAA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AAO,mBAAoB,SAAQ,cAAc,CAAA;AACrD,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,IAAI,CAAC;IACxC;8GAHW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA;;2FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACC5B,MAAO,qBAAsB,SAAQ,cAAc,CAAA;AACvD,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,SAAS,GAAG,cAAc,GAAG,IAAI,CAAC;IAC1C;8GAHW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA,CAAA;;2FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACJlC;AAYA;;ACZA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-ngx-memory.mjs","names":[],"sources":["../../../../../packages/angular/memory/src/lib/storage-utility.ts","../../../../../packages/angular/memory/src/lib/decorators/web-storage.ts","../../../../../packages/angular/memory/src/lib/decorators/local-storage.ts","../../../../../packages/angular/memory/src/lib/decorators/session-storage.ts","../../../../../packages/angular/memory/src/lib/storage.service.ts","../../../../../packages/angular/memory/src/lib/ephemeral-storage.service.ts","../../../../../packages/angular/memory/src/lib/local-storage.service.ts","../../../../../packages/angular/memory/src/lib/session-storage.service.ts"],"sourcesContent":["/**\n * Expiration time unit\n * s: seconds\n * m: minute\n * h: hour\n * d: day\n * w: week\n * y: year\n * t: Custom (millisecond)\n */\nexport type ExpiredUnit = 's' | 'm' | 'h' | 'd' | 'w' | 'y' | 't';\n\n/**\n * Determining if an Angular application is rendered in the browser\n * The Angular `PLATFORM_ID` identifier cannot be used directly by the `decorator`.\n * The advantage of this is that it also works well when the server populates the Document itself.\n */\nexport const isBrowser = typeof document === 'object' && !!document;\n\nexport function StorageGet(storage: Storage | null, key: string): unknown {\n if (storage === null) {\n return null;\n }\n const value = parse(storage.getItem(key) ?? 'null') ?? null;\n if (value === null) {\n return null;\n }\n if (typeof value === 'object' && typeof value._expired !== 'undefined' && value._expired !== 0 && +new Date() >\n value._expired) {\n StorageRemove(storage, key);\n return null;\n }\n\n return value._value ?? null;\n}\n\nexport function StorageHas(storage: Storage | null, key: string): boolean {\n if (storage === null) {\n return false;\n }\n return storage.getItem(key) !== null;\n}\n\nexport function StorageSet(\n storage: Storage | null, key: string, value: any, expiredAt = 0, expiredUnit: ExpiredUnit = 't'): void {\n if (storage === null) {\n return;\n }\n storage.setItem(\n key,\n stringify({\n _expired: getExpired(expiredAt, expiredUnit),\n _value: value,\n }),\n );\n}\n\nexport function StorageRemove(storage: Storage | null, key: string): void {\n if (storage === null) {\n return;\n }\n storage.removeItem(key);\n}\n\nexport function StorageKey(storage: Storage | null, index: number): string | null {\n if (storage === null) {\n return null;\n }\n return storage.key(index);\n}\n\nexport function getExpired(val: number, unit: ExpiredUnit): number {\n if (val <= 0) {\n return 0;\n }\n const now = +new Date();\n switch (unit) {\n case 's': // second\n return now + 1000 * val;\n case 'm': // minute\n return now + 1000 * 60 * val;\n case 'h': // hour\n return now + 1000 * 60 * 60 * val;\n case 'd': // day\n return now + 1000 * 60 * 60 * 24 * val;\n case 'w': // week\n return now + 1000 * 60 * 60 * 24 * 7 * val;\n case 'y': // year\n return now + 1000 * 60 * 60 * 24 * 365 * val;\n case 't': // customisation\n return now + val;\n default:\n throw new Error('Invalid expired unit');\n }\n return 0;\n}\n\nexport function stringify(value: any): string {\n return JSON.stringify(value);\n}\n\nfunction parse(text: string): any {\n try {\n return JSON.parse(text) ?? null;\n } catch (e) {\n return text;\n }\n}\n\nexport class MockStorage implements Storage {\n\n cache: Record<string, string> = {};\n\n get length(): number {\n return Object.keys(this.cache).length;\n }\n\n getItem(key: string): string | null {\n return this.cache[key] ?? null;\n }\n\n key(index: number): string | null {\n return Object.keys(this.cache)[index] ?? null;\n }\n\n removeItem(key: string): void {\n if (this.cache[key] !== undefined) {\n delete this.cache[key];\n }\n }\n\n setItem(key: string, value: string): void {\n this.cache[key] = value;\n }\n\n clear(): void {\n this.cache = {};\n }\n\n}\n","import {\n ExpiredUnit,\n StorageGet,\n StorageHas,\n StorageRemove,\n StorageSet,\n} from '../storage-utility';\n\n/**\n * @internal\n * @param storage\n * @param key\n * @param expiredAt\n * @param expiredUnit\n */\nexport function WebStorage(\n storage: Storage | null,\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 'd',\n) {\n return (target: any, propertyName: string): void => {\n const storageKey = key ?? propertyName;\n let propertyValue: unknown | undefined = undefined;\n Object.defineProperty(target, propertyName, {\n get: () => {\n // check if the value is set\n if (propertyValue === undefined) {\n // if not check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n return propertyValue = StorageGet(storage, storageKey);\n }\n }\n return propertyValue;\n },\n set: (value: unknown) => {\n // check if the value is set\n if (propertyValue === undefined) {\n // if not check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n // if yes, get the value from the storage\n propertyValue = StorageGet(storage, storageKey);\n return;\n }\n }\n propertyValue = value;\n // check if the value is set\n if (propertyValue === undefined) {\n // check if the value is set in the storage\n if (StorageHas(storage, storageKey)) {\n // remove any value from the storage\n StorageRemove(storage, storageKey);\n }\n } else {\n // set the value in the storage\n StorageSet(storage, storageKey, value, expiredAt, expiredUnit);\n }\n },\n enumerable: true,\n configurable: true,\n });\n };\n}\n","import {\n ExpiredUnit,\n isBrowser,\n} from '../storage-utility';\nimport { WebStorage } from './web-storage';\n\n/**\n * `localStorage` Decorator\n *\n * @param [key] Storage key\n * @param [expiredAt=0] Expiration time, 0 means forever\n * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])\n */\nexport function LocalStorage(\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 't',\n) {\n return WebStorage(isBrowser ? localStorage : null, key, expiredAt, expiredUnit);\n}\n","import {\n ExpiredUnit,\n isBrowser,\n} from '../storage-utility';\nimport { WebStorage } from './web-storage';\n\n/**\n * `sessionStorage` Decorator\n *\n * @param [key] Storage key\n * @param [expiredAt=0] Expiration time, 0 means forever\n * @param [expiredUnit='t'] Expiration time unit (default: custom [unit: ms])\n */\nexport function SessionStorage(\n key?: string,\n expiredAt = 0,\n expiredUnit: ExpiredUnit = 't',\n) {\n return WebStorage(isBrowser ? sessionStorage : null, key, expiredAt, expiredUnit);\n}\n","import { Injectable } from '@angular/core';\nimport {\n ExpiredUnit,\n StorageGet,\n StorageHas,\n StorageKey,\n StorageRemove,\n StorageSet,\n} from './storage-utility';\n\n@Injectable()\nexport abstract class StorageService {\n protected constructor(private storage: Storage | null) {}\n\n has(key: string): boolean {\n return StorageHas(this.storage, key);\n }\n\n get(key: string): any {\n return StorageGet(this.storage, key);\n }\n\n set(key: string, value: any, expiredAt = 0, expiredUnit: ExpiredUnit = 'd'): void {\n return StorageSet(this.storage, key, value, expiredAt, expiredUnit);\n }\n\n /**\n * Removes the specified key, e.g.:\n * - `remove('key')` Remove `key` key\n * - `remove(/BMap_\\w+/)` Bulk delete all keys starting with BMap_\n * @param key key name or regular expression\n */\n remove(key: string | RegExp): void {\n if (typeof key === 'string') {\n StorageRemove(this.storage, key);\n return;\n }\n let index = 0;\n let next = StorageKey(this.storage, index);\n const ls: string[] = [];\n while (next) {\n if (key.test(next)) {\n ls.push(next);\n }\n next = StorageKey(this.storage, ++index);\n }\n ls.forEach((v) => StorageRemove(this.storage, v));\n }\n\n clear(): void {\n this.storage?.clear();\n }\n}\n\n","import { Injectable } from '@angular/core';\nimport { MockStorage } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class EphemeralStorageService extends StorageService {\n\n constructor() {\n super(new MockStorage());\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { isBrowser } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalStorageService extends StorageService {\n constructor() {\n super(isBrowser ? localStorage : null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { isBrowser } from './storage-utility';\nimport { StorageService } from './storage.service';\n\n@Injectable({ providedIn: 'root' })\nexport class SessionStorageService extends StorageService {\n constructor() {\n super(isBrowser ? sessionStorage : null);\n }\n}\n"],"mappings":";;AAiBA,MAAa,YAAY,OAAO,aAAa,YAAY,CAAC,CAAC;AAE3D,SAAgB,WAAW,SAAyB,KAAW;CAC7D,IAAI,YAAY,MACd,OAAO;CAET,MAAM,QAAQ,MAAM,QAAQ,QAAQ,GAAG,KAAK,MAAM,KAAK;CACvD,IAAI,UAAU,MACZ,OAAO;CAET,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,aAAa,eAAe,MAAM,aAAa,KAAK,iBAAC,IAAI,KAAI,IACvG,MAAM,UAAU;EAClB,cAAc,SAAS,GAAG;EAC1B,OAAO;CACT;CAEA,OAAO,MAAM,UAAU;AACzB;AAEA,SAAgB,WAAW,SAAyB,KAAW;CAC7D,IAAI,YAAY,MACd,OAAO;CAET,OAAO,QAAQ,QAAQ,GAAG,MAAM;AAClC;AAEA,SAAgB,WACd,SAAyB,KAAa,OAAY,YAAY,GAAG,cAA2B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CAAuB,YAAA,CAAA;EADnC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;;ACClC,IAAa,sBAAb,MAAa,4BAA4B,eAAc;CACrD,cAAA;EACE,MAAM,YAAY,eAAe,IAAI;CACvC;CAHW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAnB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,YADN;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAD/B,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;;ACClC,IAAa,wBAAb,MAAa,8BAA8B,eAAc;CACvD,cAAA;EACE,MAAM,YAAY,iBAAiB,IAAI;CACzC;CAHW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAqB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAArB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAqB,YADR;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EADjC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
- "version": "21.0.1",
2
+ "version": "22.0.0-dev.1",
3
3
  "name": "@rxap/ngx-memory",
4
4
  "description": "This package provides Angular services and decorators for interacting with web storage (localStorage and sessionStorage) and in-memory storage. It offers a simple way to manage data persistence with expiration options and provides decorators for binding class properties directly to storage values. The package includes services for local storage, session storage, and ephemeral (in-memory) storage.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
- "@nx/devkit": "22.7.5",
8
- "tslib": "2.6.2"
7
+ "@nx/devkit": "24.0.6",
8
+ "tslib": "2.9.1"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/core": "^21.2.9"
11
+ "@angular/core": "^22.0.0"
12
12
  },
13
13
  "author": {
14
14
  "name": "Merzough Münker",
@@ -33,11 +33,11 @@
33
33
  "packageGroup": [
34
34
  {
35
35
  "package": "@angular/compiler",
36
- "version": "21.2.9"
36
+ "version": "22.3.0"
37
37
  },
38
38
  {
39
39
  "package": "@angular/core",
40
- "version": "21.2.9"
40
+ "version": "22.3.0"
41
41
  }
42
42
  ]
43
43
  },