Everything to ES2020

This commit is contained in:
the-djmaze 2024-04-02 22:24:53 +02:00
parent 84ffe1e552
commit 78178ecc2f
16 changed files with 35 additions and 45 deletions

View file

@ -23,7 +23,7 @@ try {
data = data ? decodeURIComponent(data[2]) : null;
data = data ? JSON.parse(data) : {};
win[sName] = {
getItem: key => data[key] == null ? null : data[key],
getItem: key => data[key] ?? null,
setItem: (key, value) => {
data[key] = ''+value; // forces the value to a string
document.cookie = sName+'='+encodeURIComponent(JSON.stringify(data))