-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-compiled.js
35 lines (31 loc) · 950 Bytes
/
index-compiled.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
var _hasLocalstorage = require('has-localstorage');
var _hasLocalstorage2 = _interopRequireDefault(_hasLocalstorage);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if ((0, _hasLocalstorage2.default)()) {
module.exports.storage = {
type: 'localStorage',
add: function add(key, value) {
return localStorage.setItem(key, value);
},
get: function get(key) {
return localStorage.getItem(key);
},
remove: function remove(key) {
return localStorage.removeItem(key);
}
};
} else if (chrome.storage) {
module.exports.storage = {
type: 'chromeOrWebExt',
add: function add(key, value) {
return chrome.storage.sync.set({ key: key, value: value });
},
get: function get(key) {
return chrome.storage.sync.set(key);
},
remove: function remove(key) {
return chrome.storage.sync.remove(key);
}
};
}