use LZString alias for LZStringUnsafe
This commit is contained in:
parent
b9c6be1676
commit
adabb9aeff
|
@ -1,4 +1,4 @@
|
||||||
/* global LZStringUnsafe */
|
/* global LZString */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const RX_NAMESPACE = new RegExp([/[\s\r\n]*/,
|
const RX_NAMESPACE = new RegExp([/[\s\r\n]*/,
|
||||||
|
@ -29,6 +29,8 @@ var cachedStyles = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.LZString = window.LZString || window.LZStringUnsafe;
|
||||||
|
|
||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
var [chromeLocal, chromeSync] = [
|
var [chromeLocal, chromeSync] = [
|
||||||
chrome.storage.local,
|
chrome.storage.local,
|
||||||
|
@ -63,13 +65,13 @@ var [chromeLocal, chromeSync] = [
|
||||||
return wrapper.get(keys).then((data = {}) => {
|
return wrapper.get(keys).then((data = {}) => {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
const value = data[key];
|
const value = data[key];
|
||||||
data[key] = value && tryJSONparse(LZStringUnsafe.decompressFromUTF16(value));
|
data[key] = value && tryJSONparse(LZString.decompressFromUTF16(value));
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
setLZValue(key, value) {
|
setLZValue(key, value) {
|
||||||
return wrapper.set({[key]: LZStringUnsafe.compressToUTF16(JSON.stringify(value))});
|
return wrapper.set({[key]: LZString.compressToUTF16(JSON.stringify(value))});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user