Since we are reading the value from localstorage using JSON.parse, the deserialization is handled properly automatically. Here just do : 

    window.localStorage[key] = JSON.stringify(entry);

and in get_ : 

   value = JSON.parse(value);