Permalink
Browse files

Merge pull request #38 from felipemorais/master

using storagePrefix on clear.
  • Loading branch information...
2 parents 7593119 + bf1b306 commit 9d72f3ed4d498d9c387f3877ec27a77876c56362 @sindresorhus sindresorhus committed Nov 14, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/basket.js
View
@@ -158,10 +158,9 @@
clear: function() {
var key;
var ls = localStorage;
- var re = /^basket-/;
for ( key in ls ) {
- if ( re.test( key ) ) {
+ if ( key.indexOf( storagePrefix ) === 0 ) {
delete ls[ key ];
}
}

0 comments on commit 9d72f3e

Please sign in to comment.