make proxystorage return null instead of undefined

This commit is contained in:
Jiiks 2017-01-11 20:59:24 +02:00
parent 52c4114148
commit d862285c63
2 changed files with 3 additions and 15 deletions

View File

@ -26,7 +26,7 @@
this.save();
};
__ls.getItem = function(i) {
return __ls[i];
return __ls[i] || null;
};
__ls.save = function() {
__fs.writeFileSync("localStorage.json", JSON.stringify(this), null, 4);
@ -38,7 +38,7 @@
__ls.save();
},
get: function(target, name, receiver) {
return __ls[name];
return __ls[name] || null;
}
});
@ -46,18 +46,6 @@
})();
var g = Object;
var p = new Proxy(g, {
set: function(target,name,val,receiver) {
console.log(target);
console.log(name);
console.log(val);
console.log(receiver);
}
});
window.bdStorage = {};
window.bdStorage.get = function(i) {
return betterDiscordIPC.sendSync('synchronous-message', { 'arg': 'storage', 'cmd': 'get', 'var': i });

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long