Comparing version 0.0.12 to 0.0.13
@@ -46,6 +46,13 @@ 'use strict'; | ||
get: function(k) { | ||
return store.getItem(k); | ||
var err; | ||
try { | ||
return JSON.parse(store.getItem(k)); | ||
} catch (error) { | ||
err = error; | ||
console.error('Unable to parse', k); | ||
return {}; | ||
} | ||
}, | ||
set: function(k, v) { | ||
return store.setItem(k, v); | ||
return store.setItem(k, JSON.stringify(v)); | ||
}, | ||
@@ -52,0 +59,0 @@ remove: function(k) { |
{ | ||
"name": "akasha", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Cross-browser storage with cookie-based fallback. Inspired by [store.js](https://github.com/marcuswestin/store.js/).", | ||
@@ -5,0 +5,0 @@ "main": "dist/akasha.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14279
168