Fix merge when object is undefined#40
Conversation
Codecov Report
@@ Coverage Diff @@
## master #40 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 98 99 +1
Branches 13 14 +1
=========================================
+ Hits 98 99 +1
Continue to review full report at Codecov.
|
|
Could you add a test case about this change? |
|
Hi mapple3142. In my app, I have vuex namespaced two modules. On system module, it does have a state called "auth" which is an object like the below:
So, configure vuejs-storage to persist "system.auth" state. It writes OK on localStorage, but when I try to reload app it's raising an exception that could not use operator "in" to retrieve "user". I guess the "merge" code I propposed creates an empty "user" object so it can interacts creating user attrs id and name. Hope this helps to understand. If not I'll try to give you an sample app. Thanks for your attention. |
|
I had similar problems with attributes containing null values |
Please check changes in merge.ts. That allows restoring initial null object from storage.