mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-08 19:09:00 +00:00
28 lines
449 B
TypeScript
28 lines
449 B
TypeScript
|
const mockLocalStorage = (() => {
|
||
|
let store = {} as Storage;
|
||
|
|
||
|
return {
|
||
|
getItem(key: string) {
|
||
|
return store[key];
|
||
|
},
|
||
|
|
||
|
setItem(key: string, value: string) {
|
||
|
store[key] = value;
|
||
|
},
|
||
|
|
||
|
hasOwnProperty(key: string) {
|
||
|
return store.hasOwnProperty(key);
|
||
|
},
|
||
|
|
||
|
removeItem(key: string) {
|
||
|
delete store[key];
|
||
|
},
|
||
|
|
||
|
clear() {
|
||
|
store = {} as Storage;
|
||
|
},
|
||
|
};
|
||
|
});
|
||
|
|
||
|
export default mockLocalStorage;
|