INNER CODE UNIT · TypeScript
Storage
jonasstrehle/supercookie · server/main.ts:49
class Storage {
private _path: string = path.join(path.resolve(), "data.json");
private _content: object = {};
private _contentProxy: object;
constructor() {
if (!this.existsPersistent())
this.createPersistent();
this.read();
}
public get content(): any {
return this._contentProxy;
}
public set content(data: any) {
this._content = data;
const _this = this;
const proxy = {
get(target: any, key: any) {
if (typeof target[key] === 'object' && target[key] !== null)