@daysnap/utils 0.1.29 → 0.1.31

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 (40) hide show
  1. package/docs/classes/Poller.md +9 -9
  2. package/docs/classes/Storage.md +68 -18
  3. package/docs/interfaces/EventBusCallback.md +1 -1
  4. package/docs/interfaces/PollerOptions.md +1 -1
  5. package/docs/interfaces/StorageManager.md +4 -4
  6. package/docs/interfaces/Trap.md +5 -5
  7. package/docs/modules.md +204 -163
  8. package/es/{chunk-2ZSZ4GDI.js → chunk-65FBSULU.js} +1 -2
  9. package/es/{chunk-WXD7J2FR.js → chunk-DW5GIB4A.js} +1 -2
  10. package/es/{chunk-56QUZDMU.js → chunk-SBMDM4VS.js} +36 -8
  11. package/es/chunk-YYH4INGK.js +12 -0
  12. package/es/formartDateToZN.js +1 -1
  13. package/es/formatFileSize.js +1 -1
  14. package/es/index.d.ts +2 -1
  15. package/es/index.js +22 -18
  16. package/es/isArray.d.ts +1 -1
  17. package/es/isFunction.d.ts +1 -1
  18. package/es/isNotEmpty.d.ts +6 -0
  19. package/es/isNotEmpty.js +9 -0
  20. package/es/isObject.d.ts +1 -1
  21. package/es/storage/index.js +3 -3
  22. package/es/storage/storage.d.ts +17 -5
  23. package/es/storage/storage.js +1 -1
  24. package/lib/{chunk-GQFHHWIV.cjs → chunk-247HC54W.cjs} +36 -8
  25. package/lib/{chunk-KT3FWGJG.cjs → chunk-DIJ3MI2T.cjs} +1 -2
  26. package/lib/{chunk-EDVQTNLJ.cjs → chunk-LJD6E7O5.cjs} +1 -2
  27. package/lib/chunk-LV2K7SSF.cjs +12 -0
  28. package/lib/formartDateToZN.cjs +2 -2
  29. package/lib/formatFileSize.cjs +2 -2
  30. package/lib/index.cjs +18 -14
  31. package/lib/index.d.cts +2 -1
  32. package/lib/isArray.d.cts +1 -1
  33. package/lib/isFunction.d.cts +1 -1
  34. package/lib/isNotEmpty.cjs +9 -0
  35. package/lib/isNotEmpty.d.cts +6 -0
  36. package/lib/isObject.d.cts +1 -1
  37. package/lib/storage/index.cjs +3 -3
  38. package/lib/storage/storage.cjs +2 -2
  39. package/lib/storage/storage.d.cts +17 -5
  40. package/package.json +1 -1
@@ -40,7 +40,7 @@
40
40
 
41
41
  #### Defined in
42
42
 
43
- [poller.ts:23](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L23)
43
+ [poller.ts:23](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L23)
44
44
 
45
45
  ## Properties
46
46
 
@@ -50,7 +50,7 @@
50
50
 
51
51
  #### Defined in
52
52
 
53
- [poller.ts:14](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L14)
53
+ [poller.ts:14](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L14)
54
54
 
55
55
  ___
56
56
 
@@ -60,7 +60,7 @@ ___
60
60
 
61
61
  #### Defined in
62
62
 
63
- [poller.ts:17](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L17)
63
+ [poller.ts:17](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L17)
64
64
 
65
65
  ___
66
66
 
@@ -70,7 +70,7 @@ ___
70
70
 
71
71
  #### Defined in
72
72
 
73
- [poller.ts:16](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L16)
73
+ [poller.ts:16](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L16)
74
74
 
75
75
  ___
76
76
 
@@ -80,7 +80,7 @@ ___
80
80
 
81
81
  #### Defined in
82
82
 
83
- [poller.ts:15](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L15)
83
+ [poller.ts:15](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L15)
84
84
 
85
85
  ## Accessors
86
86
 
@@ -94,7 +94,7 @@ ___
94
94
 
95
95
  #### Defined in
96
96
 
97
- [poller.ts:19](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L19)
97
+ [poller.ts:19](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L19)
98
98
 
99
99
  ## Methods
100
100
 
@@ -114,7 +114,7 @@ ___
114
114
 
115
115
  #### Defined in
116
116
 
117
- [poller.ts:28](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L28)
117
+ [poller.ts:28](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L28)
118
118
 
119
119
  ___
120
120
 
@@ -134,7 +134,7 @@ ___
134
134
 
135
135
  #### Defined in
136
136
 
137
- [poller.ts:46](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L46)
137
+ [poller.ts:46](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L46)
138
138
 
139
139
  ___
140
140
 
@@ -148,4 +148,4 @@ ___
148
148
 
149
149
  #### Defined in
150
150
 
151
- [poller.ts:41](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L41)
151
+ [poller.ts:41](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L41)
@@ -17,11 +17,14 @@
17
17
  ### Properties
18
18
 
19
19
  - [key](Storage.md#key)
20
+ - [options](Storage.md#options)
20
21
  - [storage](Storage.md#storage)
21
22
  - [value](Storage.md#value)
22
23
 
23
24
  ### Methods
24
25
 
26
+ - [\_debug](Storage.md#_debug)
27
+ - [clearCache](Storage.md#clearcache)
25
28
  - [getItem](Storage.md#getitem)
26
29
  - [getItemOnce](Storage.md#getitemonce)
27
30
  - [getItemWithCache](Storage.md#getitemwithcache)
@@ -33,7 +36,7 @@
33
36
 
34
37
  ### constructor
35
38
 
36
- • **new Storage**<`T`\>(`key`, `storage`)
39
+ • **new Storage**<`T`\>(`key`, `storage`, `options?`)
37
40
 
38
41
  #### Type parameters
39
42
 
@@ -47,10 +50,11 @@
47
50
  | :------ | :------ |
48
51
  | `key` | `string` |
49
52
  | `storage` | `StorageLike` |
53
+ | `options?` | `Partial`<`StorageOptions`<`T`\>\> |
50
54
 
51
55
  #### Defined in
52
56
 
53
- [storage/storage.ts:15](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L15)
57
+ [storage/storage.ts:24](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L24)
54
58
 
55
59
  ## Properties
56
60
 
@@ -60,7 +64,17 @@
60
64
 
61
65
  #### Defined in
62
66
 
63
- [storage/storage.ts:11](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L11)
67
+ [storage/storage.ts:19](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L19)
68
+
69
+ ___
70
+
71
+ ### options
72
+
73
+ • `Private` **options**: `StorageOptions`<`T`\>
74
+
75
+ #### Defined in
76
+
77
+ [storage/storage.ts:22](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L22)
64
78
 
65
79
  ___
66
80
 
@@ -70,7 +84,7 @@ ___
70
84
 
71
85
  #### Defined in
72
86
 
73
- [storage/storage.ts:12](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L12)
87
+ [storage/storage.ts:20](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L20)
74
88
 
75
89
  ___
76
90
 
@@ -80,10 +94,46 @@ ___
80
94
 
81
95
  #### Defined in
82
96
 
83
- [storage/storage.ts:13](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L13)
97
+ [storage/storage.ts:21](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L21)
84
98
 
85
99
  ## Methods
86
100
 
101
+ ### \_debug
102
+
103
+ ▸ **_debug**(`...args`): `void`
104
+
105
+ #### Parameters
106
+
107
+ | Name | Type |
108
+ | :------ | :------ |
109
+ | `...args` | `string`[] |
110
+
111
+ #### Returns
112
+
113
+ `void`
114
+
115
+ #### Defined in
116
+
117
+ [storage/storage.ts:43](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L43)
118
+
119
+ ___
120
+
121
+ ### clearCache
122
+
123
+ ▸ **clearCache**(): `void`
124
+
125
+ 清除缓存
126
+
127
+ #### Returns
128
+
129
+ `void`
130
+
131
+ #### Defined in
132
+
133
+ [storage/storage.ts:137](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L137)
134
+
135
+ ___
136
+
87
137
  ### getItem
88
138
 
89
139
  ▸ **getItem**(): ``null`` \| `T`
@@ -96,7 +146,7 @@ ___
96
146
 
97
147
  #### Defined in
98
148
 
99
- [storage/storage.ts:32](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L32)
149
+ [storage/storage.ts:65](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L65)
100
150
 
101
151
  ▸ **getItem**(`defaultVal`): `T`
102
152
 
@@ -104,7 +154,7 @@ ___
104
154
 
105
155
  | Name | Type |
106
156
  | :------ | :------ |
107
- | `defaultVal` | `Partial`<`T`\> |
157
+ | `defaultVal` | `DefaultVal`<`T`\> |
108
158
 
109
159
  #### Returns
110
160
 
@@ -112,7 +162,7 @@ ___
112
162
 
113
163
  #### Defined in
114
164
 
115
- [storage/storage.ts:33](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L33)
165
+ [storage/storage.ts:66](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L66)
116
166
 
117
167
  ___
118
168
 
@@ -128,7 +178,7 @@ ___
128
178
 
129
179
  #### Defined in
130
180
 
131
- [storage/storage.ts:69](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L69)
181
+ [storage/storage.ts:102](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L102)
132
182
 
133
183
  ▸ **getItemOnce**(`defaultVal`): `T`
134
184
 
@@ -136,7 +186,7 @@ ___
136
186
 
137
187
  | Name | Type |
138
188
  | :------ | :------ |
139
- | `defaultVal` | `Partial`<`T`\> |
189
+ | `defaultVal` | `DefaultVal`<`T`\> |
140
190
 
141
191
  #### Returns
142
192
 
@@ -144,7 +194,7 @@ ___
144
194
 
145
195
  #### Defined in
146
196
 
147
- [storage/storage.ts:70](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L70)
197
+ [storage/storage.ts:103](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L103)
148
198
 
149
199
  ___
150
200
 
@@ -160,7 +210,7 @@ ___
160
210
 
161
211
  #### Defined in
162
212
 
163
- [storage/storage.ts:85](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L85)
213
+ [storage/storage.ts:115](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L115)
164
214
 
165
215
  ▸ **getItemWithCache**(`defaultVal`): `T`
166
216
 
@@ -168,7 +218,7 @@ ___
168
218
 
169
219
  | Name | Type |
170
220
  | :------ | :------ |
171
- | `defaultVal` | `Partial`<`T`\> |
221
+ | `defaultVal` | `DefaultVal`<`T`\> |
172
222
 
173
223
  #### Returns
174
224
 
@@ -176,7 +226,7 @@ ___
176
226
 
177
227
  #### Defined in
178
228
 
179
- [storage/storage.ts:86](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L86)
229
+ [storage/storage.ts:116](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L116)
180
230
 
181
231
  ___
182
232
 
@@ -192,7 +242,7 @@ ___
192
242
 
193
243
  #### Defined in
194
244
 
195
- [storage/storage.ts:45](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L45)
245
+ [storage/storage.ts:78](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L78)
196
246
 
197
247
  ___
198
248
 
@@ -214,7 +264,7 @@ ___
214
264
 
215
265
  #### Defined in
216
266
 
217
- [storage/storage.ts:23](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L23)
267
+ [storage/storage.ts:52](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L52)
218
268
 
219
269
  ___
220
270
 
@@ -228,7 +278,7 @@ ___
228
278
 
229
279
  | Name | Type |
230
280
  | :------ | :------ |
231
- | `val` | `Partial`<`T`\> |
281
+ | `val` | `DefaultVal`<`T`\> |
232
282
 
233
283
  #### Returns
234
284
 
@@ -236,4 +286,4 @@ ___
236
286
 
237
287
  #### Defined in
238
288
 
239
- [storage/storage.ts:53](https://github.com/daysnap/utils/blob/e7ac628/src/storage/storage.ts#L53)
289
+ [storage/storage.ts:86](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/storage.ts#L86)
@@ -20,4 +20,4 @@
20
20
 
21
21
  #### Defined in
22
22
 
23
- [eventBus.ts:2](https://github.com/daysnap/utils/blob/e7ac628/src/eventBus.ts#L2)
23
+ [eventBus.ts:2](https://github.com/daysnap/utils/blob/2af7b5c/src/eventBus.ts#L2)
@@ -16,4 +16,4 @@
16
16
 
17
17
  #### Defined in
18
18
 
19
- [poller.ts:10](https://github.com/daysnap/utils/blob/e7ac628/src/poller.ts#L10)
19
+ [poller.ts:10](https://github.com/daysnap/utils/blob/2af7b5c/src/poller.ts#L10)
@@ -35,7 +35,7 @@
35
35
 
36
36
  #### Defined in
37
37
 
38
- [storage/factory.ts:6](https://github.com/daysnap/utils/blob/e7ac628/src/storage/factory.ts#L6)
38
+ [storage/factory.ts:6](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/factory.ts#L6)
39
39
 
40
40
  ___
41
41
 
@@ -49,7 +49,7 @@ ___
49
49
 
50
50
  #### Defined in
51
51
 
52
- [storage/factory.ts:7](https://github.com/daysnap/utils/blob/e7ac628/src/storage/factory.ts#L7)
52
+ [storage/factory.ts:7](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/factory.ts#L7)
53
53
 
54
54
  ___
55
55
 
@@ -69,7 +69,7 @@ ___
69
69
 
70
70
  #### Defined in
71
71
 
72
- [storage/factory.ts:5](https://github.com/daysnap/utils/blob/e7ac628/src/storage/factory.ts#L5)
72
+ [storage/factory.ts:5](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/factory.ts#L5)
73
73
 
74
74
  ___
75
75
 
@@ -89,4 +89,4 @@ ___
89
89
 
90
90
  #### Defined in
91
91
 
92
- [storage/factory.ts:8](https://github.com/daysnap/utils/blob/e7ac628/src/storage/factory.ts#L8)
92
+ [storage/factory.ts:8](https://github.com/daysnap/utils/blob/2af7b5c/src/storage/factory.ts#L8)
@@ -31,7 +31,7 @@
31
31
 
32
32
  #### Defined in
33
33
 
34
- [trap.ts:12](https://github.com/daysnap/utils/blob/e7ac628/src/trap.ts#L12)
34
+ [trap.ts:12](https://github.com/daysnap/utils/blob/2af7b5c/src/trap.ts#L12)
35
35
 
36
36
  ___
37
37
 
@@ -56,7 +56,7 @@ ___
56
56
 
57
57
  #### Defined in
58
58
 
59
- [trap.ts:10](https://github.com/daysnap/utils/blob/e7ac628/src/trap.ts#L10)
59
+ [trap.ts:10](https://github.com/daysnap/utils/blob/2af7b5c/src/trap.ts#L10)
60
60
 
61
61
  ___
62
62
 
@@ -80,7 +80,7 @@ ___
80
80
 
81
81
  #### Defined in
82
82
 
83
- [trap.ts:11](https://github.com/daysnap/utils/blob/e7ac628/src/trap.ts#L11)
83
+ [trap.ts:11](https://github.com/daysnap/utils/blob/2af7b5c/src/trap.ts#L11)
84
84
 
85
85
  ___
86
86
 
@@ -90,7 +90,7 @@ ___
90
90
 
91
91
  #### Defined in
92
92
 
93
- [trap.ts:8](https://github.com/daysnap/utils/blob/e7ac628/src/trap.ts#L8)
93
+ [trap.ts:8](https://github.com/daysnap/utils/blob/2af7b5c/src/trap.ts#L8)
94
94
 
95
95
  ___
96
96
 
@@ -115,4 +115,4 @@ ___
115
115
 
116
116
  #### Defined in
117
117
 
118
- [trap.ts:9](https://github.com/daysnap/utils/blob/e7ac628/src/trap.ts#L9)
118
+ [trap.ts:9](https://github.com/daysnap/utils/blob/2af7b5c/src/trap.ts#L9)