dphelper 1.8.82 β 1.8.92
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/README.md +21 -14
- package/docs/index.md +21 -14
- package/documents/STATE.md +13 -5
- package/documents/STORE.md +64 -64
- package/documents/TOOLS.md +569 -567
- package/index.js +1 -1
- package/package.json +3 -3
- package/types/dphelper.d.ts +1 -1
- package/types/state.d.ts +11 -0
- package/types/store.d.ts +4 -0
package/README.md
CHANGED
|
@@ -116,24 +116,31 @@ You can use the browser's devtools console and type " **state.test = 'I am ready
|
|
|
116
116
|
|
|
117
117
|
```javascript
|
|
118
118
|
// Set a state
|
|
119
|
-
state.test = "I am ready"
|
|
119
|
+
state.test = "I am ready" *
|
|
120
120
|
|
|
121
121
|
// Get the state
|
|
122
|
-
state.test
|
|
122
|
+
state.test *
|
|
123
123
|
|
|
124
124
|
// List all states
|
|
125
125
|
state.list // or just "state" to see the proxy
|
|
126
126
|
|
|
127
|
+
// Lock a state from edit (Only for Objects or Array)
|
|
128
|
+
state.test.lock() *
|
|
129
|
+
|
|
127
130
|
// Remove a state
|
|
128
131
|
state.remove("test")
|
|
132
|
+
|
|
133
|
+
// Remove all states
|
|
134
|
+
state.removeAll()
|
|
135
|
+
|
|
136
|
+
*["test" is only an example]
|
|
137
|
+
|
|
129
138
|
```
|
|
130
139
|
|
|
131
140
|
### Observer π for States
|
|
132
141
|
|
|
133
142
|
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
134
143
|
|
|
135
|
-
π₯NEWπ₯: Great, now you can use nested objects in observer. You need to declare "state." or "store." before selecting the object you want to monitor.
|
|
136
|
-
|
|
137
144
|
If you want to run a function every time a state changes, you can use:
|
|
138
145
|
|
|
139
146
|
```javascript
|
|
@@ -199,7 +206,7 @@ When using dpHelper for permanent storage, you should use the **store**, which s
|
|
|
199
206
|
|
|
200
207
|
2. **Remove data when necessary:** To maintain security, remove stored data when it is no longer needed, such as during logout.
|
|
201
208
|
|
|
202
|
-
3. **
|
|
209
|
+
3. **Remove all stored data:** Use store.removeAll() to securely remove all stored data from your application.
|
|
203
210
|
|
|
204
211
|
```javascript
|
|
205
212
|
// Set a store:
|
|
@@ -209,10 +216,10 @@ store.set("test", { test: "test" })
|
|
|
209
216
|
store.get("test") // Output: { test: "test" }
|
|
210
217
|
|
|
211
218
|
// Remove a store:
|
|
212
|
-
store.
|
|
219
|
+
store.remove("test") // Output: "ok"
|
|
213
220
|
|
|
214
221
|
// Remove all stores:
|
|
215
|
-
store.
|
|
222
|
+
store.removeAll() // Output: "ok"
|
|
216
223
|
```
|
|
217
224
|
|
|
218
225
|
### Example in React
|
|
@@ -240,8 +247,8 @@ function App() {
|
|
|
240
247
|
}, []
|
|
241
248
|
);
|
|
242
249
|
|
|
243
|
-
//
|
|
244
|
-
// store.
|
|
250
|
+
// Remove all stored data if necessary
|
|
251
|
+
// store.removeAll();
|
|
245
252
|
|
|
246
253
|
return (
|
|
247
254
|
<div>
|
|
@@ -269,7 +276,7 @@ Chrome: [Download from Google Web Store](https://chrome.google.com/webstore/deta
|
|
|
269
276
|
|
|
270
277
|
Edge: [Download from Microsoft Addons](https://microsoftedge.microsoft.com/addons/detail/dphelper-manager-dev-to/kphabkbdpaljlfagldhojilhfammepnk)
|
|
271
278
|
|
|
272
|
-
PS: **dpHelper** is compatible with all Chromium-based browsers like **Brave
|
|
279
|
+
PS: **dpHelper** is compatible with all Chromium-based browsers like **Edge or Brave**!
|
|
273
280
|
|
|
274
281
|
## dpHelper Browser Extension
|
|
275
282
|
|
|
@@ -291,10 +298,10 @@ The dpHelper browser extension allows you to manage your application's dpHelper
|
|
|
291
298
|
|
|
292
299
|
[MIT - https://en.wikipedia.org/wiki/MIT_License](https://en.wikipedia.org/wiki/MIT_License)
|
|
293
300
|
|
|
294
|
-
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/
|
|
295
|
-
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/
|
|
296
|
-
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/
|
|
297
|
-
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/
|
|
301
|
+
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/documents/license)
|
|
302
|
+
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/documents/code_of_conduct)
|
|
303
|
+
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/documents/security)
|
|
304
|
+
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/documents/contributing)
|
|
298
305
|
|
|
299
306
|
---
|
|
300
307
|
|
package/docs/index.md
CHANGED
|
@@ -116,24 +116,31 @@ You can use the browser's devtools console and type " **state.test = 'I am ready
|
|
|
116
116
|
|
|
117
117
|
```javascript
|
|
118
118
|
// Set a state
|
|
119
|
-
state.test = "I am ready"
|
|
119
|
+
state.test = "I am ready" *
|
|
120
120
|
|
|
121
121
|
// Get the state
|
|
122
|
-
state.test
|
|
122
|
+
state.test *
|
|
123
123
|
|
|
124
124
|
// List all states
|
|
125
125
|
state.list // or just "state" to see the proxy
|
|
126
126
|
|
|
127
|
+
// Lock a state from edit (Only for Objects or Array)
|
|
128
|
+
state.test.lock() *
|
|
129
|
+
|
|
127
130
|
// Remove a state
|
|
128
131
|
state.remove("test")
|
|
132
|
+
|
|
133
|
+
// Remove all states
|
|
134
|
+
state.removeAll()
|
|
135
|
+
|
|
136
|
+
*["test" is only an example]
|
|
137
|
+
|
|
129
138
|
```
|
|
130
139
|
|
|
131
140
|
### Observer π for States
|
|
132
141
|
|
|
133
142
|
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
134
143
|
|
|
135
|
-
π₯NEWπ₯: Great, now you can use nested objects in observer. You need to declare "state." or "store." before selecting the object you want to monitor.
|
|
136
|
-
|
|
137
144
|
If you want to run a function every time a state changes, you can use:
|
|
138
145
|
|
|
139
146
|
```javascript
|
|
@@ -199,7 +206,7 @@ When using dpHelper for permanent storage, you should use the **store**, which s
|
|
|
199
206
|
|
|
200
207
|
2. **Remove data when necessary:** To maintain security, remove stored data when it is no longer needed, such as during logout.
|
|
201
208
|
|
|
202
|
-
3. **
|
|
209
|
+
3. **Remove all stored data:** Use store.removeAll() to securely remove all stored data from your application.
|
|
203
210
|
|
|
204
211
|
```javascript
|
|
205
212
|
// Set a store:
|
|
@@ -209,10 +216,10 @@ store.set("test", { test: "test" })
|
|
|
209
216
|
store.get("test") // Output: { test: "test" }
|
|
210
217
|
|
|
211
218
|
// Remove a store:
|
|
212
|
-
store.
|
|
219
|
+
store.remove("test") // Output: "ok"
|
|
213
220
|
|
|
214
221
|
// Remove all stores:
|
|
215
|
-
store.
|
|
222
|
+
store.removeAll() // Output: "ok"
|
|
216
223
|
```
|
|
217
224
|
|
|
218
225
|
### Example in React
|
|
@@ -240,8 +247,8 @@ function App() {
|
|
|
240
247
|
}, []
|
|
241
248
|
);
|
|
242
249
|
|
|
243
|
-
//
|
|
244
|
-
// store.
|
|
250
|
+
// Remove all stored data if necessary
|
|
251
|
+
// store.removeAll();
|
|
245
252
|
|
|
246
253
|
return (
|
|
247
254
|
<div>
|
|
@@ -269,7 +276,7 @@ Chrome: [Download from Google Web Store](https://chrome.google.com/webstore/deta
|
|
|
269
276
|
|
|
270
277
|
Edge: [Download from Microsoft Addons](https://microsoftedge.microsoft.com/addons/detail/dphelper-manager-dev-to/kphabkbdpaljlfagldhojilhfammepnk)
|
|
271
278
|
|
|
272
|
-
PS: **dpHelper** is compatible with all Chromium-based browsers like **Brave
|
|
279
|
+
PS: **dpHelper** is compatible with all Chromium-based browsers like **Edge or Brave**!
|
|
273
280
|
|
|
274
281
|
## dpHelper Browser Extension
|
|
275
282
|
|
|
@@ -291,10 +298,10 @@ The dpHelper browser extension allows you to manage your application's dpHelper
|
|
|
291
298
|
|
|
292
299
|
[MIT - https://en.wikipedia.org/wiki/MIT_License](https://en.wikipedia.org/wiki/MIT_License)
|
|
293
300
|
|
|
294
|
-
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/
|
|
295
|
-
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/
|
|
296
|
-
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/
|
|
297
|
-
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/
|
|
301
|
+
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/documents/license)
|
|
302
|
+
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/documents/code_of_conduct)
|
|
303
|
+
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/documents/security)
|
|
304
|
+
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/documents/contributing)
|
|
298
305
|
|
|
299
306
|
---
|
|
300
307
|
|
package/documents/STATE.md
CHANGED
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
## Overview
|
|
4
4
|
This document provides a comprehensive list of all available state functions in the `dphelper` library along with their descriptions and examples.
|
|
5
5
|
|
|
6
|
-
### News :)
|
|
7
|
-
Now if you try to override the root state you get a message error!
|
|
8
|
-
Also, now you can lock a state using example: __state.[stateName].lock()__
|
|
9
|
-
|
|
10
6
|
## Functions
|
|
11
7
|
|
|
12
8
|
### state.[state.name] ex: _state.test_
|
|
@@ -39,7 +35,7 @@ Also, now you can lock a state using example: __state.[stateName].lock()__
|
|
|
39
35
|
### state.name.lock()
|
|
40
36
|
|
|
41
37
|
>>> New option!
|
|
42
|
-
- **Description:** Lock a state.
|
|
38
|
+
- **Description:** Lock a state (only for types: Array, Object).
|
|
43
39
|
- **Example:**
|
|
44
40
|
```javascript
|
|
45
41
|
state.name = {test:"test"}
|
|
@@ -47,5 +43,17 @@ Also, now you can lock a state using example: __state.[stateName].lock()__
|
|
|
47
43
|
"Now you can't add more data or remove it"
|
|
48
44
|
```
|
|
49
45
|
|
|
46
|
+
### state.removeAll()
|
|
47
|
+
|
|
48
|
+
>>> New option!
|
|
49
|
+
- **Description:** Remove all states.
|
|
50
|
+
- **Example:**
|
|
51
|
+
```javascript
|
|
52
|
+
state.name = {test:"test"}
|
|
53
|
+
state.removeAll();
|
|
54
|
+
"Now you can't see state.name (all states are removed)"
|
|
55
|
+
"Use for Log-out / Sign-out operation"
|
|
56
|
+
```
|
|
57
|
+
|
|
50
58
|
## License
|
|
51
59
|
This project is licensed under the MIT License.
|
package/documents/STORE.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# dpHelper Store
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
5
|
-
|
|
6
|
-
## Functions
|
|
7
|
-
|
|
8
|
-
### store.get([store.name])
|
|
9
|
-
- **Description:** Retrieve an item from local storage.
|
|
10
|
-
- **Parameters:**
|
|
11
|
-
- `name` (string): The name of the item to retrieve.
|
|
12
|
-
- **Example:**
|
|
13
|
-
```javascript
|
|
14
|
-
const value = store.get('itemName');
|
|
15
|
-
console.log(value);
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### store.set([name, value])
|
|
19
|
-
- **Description:** Set an item in local storage.
|
|
20
|
-
- **Parameters:**
|
|
21
|
-
- `name` (string): The name of the item to set.
|
|
22
|
-
- `value` (any): The value of the item to set.
|
|
23
|
-
- **Example:**
|
|
24
|
-
```javascript
|
|
25
|
-
store.set('itemName', value);
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### store.
|
|
29
|
-
- **Description:** Delete an item from local storage.
|
|
30
|
-
- **Parameters:**
|
|
31
|
-
- `name` (string): The name of the item to delete.
|
|
32
|
-
- **Example:**
|
|
33
|
-
```javascript
|
|
34
|
-
store.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### store.
|
|
38
|
-
- **Description:**
|
|
39
|
-
- **Parameters:** None
|
|
40
|
-
- **Example:**
|
|
41
|
-
```javascript
|
|
42
|
-
store.
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### store.quota()
|
|
46
|
-
- **Description:** Estimate the storage quota and usage.
|
|
47
|
-
- **Parameters:** None
|
|
48
|
-
- **Example:**
|
|
49
|
-
```javascript
|
|
50
|
-
const quota = store.quota();
|
|
51
|
-
console.log(quota);
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### store.size()
|
|
55
|
-
- **Description:** Calculate the total size of all items in local storage.
|
|
56
|
-
- **Parameters:** None
|
|
57
|
-
- **Example:**
|
|
58
|
-
```javascript
|
|
59
|
-
const totalSize = store.size();
|
|
60
|
-
console.log(totalSize);
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## License
|
|
64
|
-
This project is licensed under the MIT License.
|
|
1
|
+
# dpHelper Store
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
5
|
+
|
|
6
|
+
## Functions
|
|
7
|
+
|
|
8
|
+
### store.get([store.name])
|
|
9
|
+
- **Description:** Retrieve an item from local storage.
|
|
10
|
+
- **Parameters:**
|
|
11
|
+
- `name` (string): The name of the item to retrieve.
|
|
12
|
+
- **Example:**
|
|
13
|
+
```javascript
|
|
14
|
+
const value = store.get('itemName');
|
|
15
|
+
console.log(value);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### store.set([name, value])
|
|
19
|
+
- **Description:** Set an item in local storage.
|
|
20
|
+
- **Parameters:**
|
|
21
|
+
- `name` (string): The name of the item to set.
|
|
22
|
+
- `value` (any): The value of the item to set.
|
|
23
|
+
- **Example:**
|
|
24
|
+
```javascript
|
|
25
|
+
store.set('itemName', value);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### store.remove([store.name])
|
|
29
|
+
- **Description:** Delete an item from local storage.
|
|
30
|
+
- **Parameters:**
|
|
31
|
+
- `name` (string): The name of the item to delete.
|
|
32
|
+
- **Example:**
|
|
33
|
+
```javascript
|
|
34
|
+
store.remove('itemName');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### store.removeAll()
|
|
38
|
+
- **Description:** Remove all items from local storage.
|
|
39
|
+
- **Parameters:** None
|
|
40
|
+
- **Example:**
|
|
41
|
+
```javascript
|
|
42
|
+
store.removeAll();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### store.quota()
|
|
46
|
+
- **Description:** Estimate the storage quota and usage.
|
|
47
|
+
- **Parameters:** None
|
|
48
|
+
- **Example:**
|
|
49
|
+
```javascript
|
|
50
|
+
const quota = store.quota();
|
|
51
|
+
console.log(quota);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### store.size()
|
|
55
|
+
- **Description:** Calculate the total size of all items in local storage.
|
|
56
|
+
- **Parameters:** None
|
|
57
|
+
- **Example:**
|
|
58
|
+
```javascript
|
|
59
|
+
const totalSize = store.size();
|
|
60
|
+
console.log(totalSize);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
This project is licensed under the MIT License.
|