Open JimCronqvist opened 2 weeks ago
That's not really intended, check should be indeed more precise and only check for undefined, not falsy values. Feel free to open an issue / PR on the upstream repo. Just gotta make sure everything still works as expected 🫡
Are you using Nuxt?
Describe the bug
Falsy values are not persisted when using pick, but rather filtered away.
Relevant configuration:
persist: { pick: ['selectedIndex'] }
If the value for
selectedIndex
is0
, the selectedIndex would not be persisted.From what I can see, this is caused by this line below which filters away falsy values. https://github.com/prazdevs/deep-pick-omit/blob/f71e364a33fd2eb1ce8c0e71b2788f4abe8cee67/src/index.ts#L29
Is it possible to retain those values instead? (probably doesn't matter, but Vuex did keep those and made the upgrade unexpected)
Happy to create a PR in that library for the actual change if it helps, but I wanted to check first unless this was intended behavior.
Thanks for all your work on the plugin!
Reproduction
n/a
System Info
Used Package Manager
yarn
Validations