-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Unfortunately I rely on things like Object.keys(localStorage) to give me the keys of all items stored.
var isolated = new MemoryStorage('my-app');
isolated.setItem("test", JSON.stringify({ key: "value" }));
Object.keys(isolated);
/// returns ["id", "length", "getItem", "setItem", "removeItem", "key", "clear", "test"]
localStorage.setItem("test", JSON.stringify({ key: "value" }));
Object.keys(localStorage);
/// returns ["test"] It might be related, also that the output of applying JSON.stringify is not compatile to localStorage. It should be
JSON.stringify(localStorage)
// returns {"test":"{\"key\":\"value\"}"}but instead it is
JSON.stringify(isolated)
// returns {"id":"my-app","length":1,"test":"{\"key\":\"value\"}"}Perhaps one should define a .toJSON method to fix that behaviour.
With best regards
Semmel
Metadata
Metadata
Assignees
Labels
No labels