dyna-config-handler
Version:
Simplifies the configuration handling in json files for node-js applications
28 lines (20 loc) • 383 B
text/typescript
declare let global: any;
class LocalStorageMock {
private store: any;
constructor() {
this.store = {};
}
clear() {
this.store = {};
}
getItem(key: string) {
return this.store[key];
}
setItem(key: string, value: string) {
this.store[key] = value;
}
removeItem(key: string) {
delete this.store[key];
}
}
(global as any).localStorage = new LocalStorageMock;