MyCrypto/spec/mocks/localStorage.js

22 lines
295 B
JavaScript
Raw Normal View History

export default class LocalStorageMock {
constructor() {
this.store = {};
}
clear() {
this.store = {};
}
getItem(key) {
return this.store[key];
}
setItem(key, value) {
this.store[key] = value.toString();
}
removeItem(key) {
delete this.store[key];
}
}