yarkovaleksei/vue2-storage

keys() should honor ttl

halaprop opened this issue · 1 comments

Hi -

this.$storage.set('key', 'value', { ttl: 5 * 1000 })
// wait 6 seconds or more
this.$storage.keys()

I expect keys to be empty. Instead keys are ['app_key']. Shouldn't keys() use the same expiration logic as get()?

this.$storage.get('key') // returns null as expected

Same issue with key(index), which calls keys()

@halaprop , thank you for your comment. Yes, indeed, I did not take into account this nuance. Will definitely fix it soon.