tymondesigns / angular-locker

🗄️ A simple & configurable abstraction for local/session storage in angular js projects
https://npm.im/angular-locker
MIT License
314 stars 42 forks source link

clean() does not work on 'session' driver and namespace with a dot #32

Open RhonanMS opened 8 years ago

RhonanMS commented 8 years ago

I am using clean() to remove all values from a given namespace. However, if the namespace contains a dot within it's name (e.g. 'test.namespace'), on my Chrome the namespace is not cleared of its values afterwards.

The following test case should demonstrate the problem:

locker.driver('session').namespace('test.namespace').put('test', 'testvalue'); locker.driver('session').namespace('test.namespace').clean();

In Chrome, the resource view for the session storage returns the following afterwards: 'test.namespace.test' => 'testvalue'

Could it be that the dotted namespace screws up the cleaning algorithm?

The version used is 2.0.4

tymondesigns commented 8 years ago

Hmm.. I will take a look into it, Thanks