use LZString alias for LZStringUnsafe
This commit is contained in:
parent
b9c6be1676
commit
adabb9aeff
|
@ -1,4 +1,4 @@
|
|||
/* global LZStringUnsafe */
|
||||
/* global LZString */
|
||||
'use strict';
|
||||
|
||||
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
|
||||
var [chromeLocal, chromeSync] = [
|
||||
chrome.storage.local,
|
||||
|
@ -63,13 +65,13 @@ var [chromeLocal, chromeSync] = [
|
|||
return wrapper.get(keys).then((data = {}) => {
|
||||
for (const key of keys) {
|
||||
const value = data[key];
|
||||
data[key] = value && tryJSONparse(LZStringUnsafe.decompressFromUTF16(value));
|
||||
data[key] = value && tryJSONparse(LZString.decompressFromUTF16(value));
|
||||
}
|
||||
return data;
|
||||
});
|
||||
},
|
||||
setLZValue(key, value) {
|
||||
return wrapper.set({[key]: LZStringUnsafe.compressToUTF16(JSON.stringify(value))});
|
||||
return wrapper.set({[key]: LZString.compressToUTF16(JSON.stringify(value))});
|
||||
}
|
||||
};
|
||||
return wrapper;
|
||||
|
|
Loading…
Reference in New Issue
Block a user