INNER CODE UNIT · TypeScript
content
jonasstrehle/supercookie · server/main.ts:61
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)
return new Proxy(target[key], proxy)
else return target[key];
},
set (target: any, key: any, value: any): any {
target[key] = value;
_this.write(_this.content);
return true;
}
}
this._contentProxy = new Proxy(this._content, proxy);
_this.write(_this.content);
}