File tree Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Original file line number Diff line number Diff line change 4343 " save"
4444 ],
4545 "dependencies" : {
46- "conf" : " ^14 .0.0" ,
47- "type-fest" : " ^4.41.0 "
46+ "conf" : " ^15 .0.0" ,
47+ "type-fest" : " ^5.0.1 "
4848 },
4949 "devDependencies" : {
50- "ava" : " ^6.4.0 " ,
51- "electron" : " ^31.0.1 " ,
50+ "ava" : " ^6.4.1 " ,
51+ "electron" : " ^38.1.2 " ,
5252 "execa" : " ^9.6.0" ,
53- "tsd" : " ^0.32 .0" ,
54- "xo" : " ^0.58 .0"
53+ "tsd" : " ^0.33 .0" ,
54+ "xo" : " ^0.60 .0"
5555 },
5656 "xo" : {
5757 "envs" : [
5858 " node" ,
5959 " browser"
60- ]
60+ ],
61+ "rules" : {
62+ "n/no-unsupported-features/node-builtins" : " off"
63+ }
6164 },
6265 "tsd" : {
6366 "compilerOptions" : {
Original file line number Diff line number Diff line change @@ -318,6 +318,26 @@ Check if an item exists.
318318
319319Delete an item.
320320
321+ #### .appendToArray(key, value)
322+
323+ Append an item to an array.
324+
325+ If the key doesn't exist, it will be created as an array. If the key exists and is not an array, a ` TypeError ` will be thrown.
326+
327+ The ` value ` must be JSON serializable. Trying to set the type like ` undefined ` , ` function ` , or ` symbol ` will result in a ` TypeError ` .
328+
329+ ``` js
330+ store .set (' items' , [{name: ' foo' }]);
331+ store .appendToArray (' items' , {name: ' bar' });
332+ console .log (store .get (' items' ));
333+ // => [{name: 'foo'}, {name: 'bar'}]
334+
335+ // Creates array if key doesn't exist
336+ store .appendToArray (' newItems' , ' first' );
337+ console .log (store .get (' newItems' ));
338+ // => ['first']
339+ ```
340+
321341#### .clear()
322342
323343Delete all items.
You can’t perform that action at this time.
0 commit comments