cosmetics
This commit is contained in:
parent
6cda84df66
commit
27c713e11e
|
@ -5,13 +5,6 @@
|
||||||
* Common stuff that's loaded first so it's immediately available to all background scripts
|
* Common stuff that's loaded first so it's immediately available to all background scripts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* exported
|
|
||||||
addAPI
|
|
||||||
bgReady
|
|
||||||
createCache
|
|
||||||
uuidIndex
|
|
||||||
*/
|
|
||||||
|
|
||||||
const bgReady = {};
|
const bgReady = {};
|
||||||
bgReady.styles = new Promise(r => (bgReady._resolveStyles = r));
|
bgReady.styles = new Promise(r => (bgReady._resolveStyles = r));
|
||||||
bgReady.all = new Promise(r => (bgReady._resolveAll = r));
|
bgReady.all = new Promise(r => (bgReady._resolveAll = r));
|
||||||
|
@ -26,6 +19,7 @@ const uuidIndex = Object.assign(new Map(), {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* exported addAPI */
|
||||||
function addAPI(methods) {
|
function addAPI(methods) {
|
||||||
for (const [key, val] of Object.entries(methods)) {
|
for (const [key, val] of Object.entries(methods)) {
|
||||||
const old = API[key];
|
const old = API[key];
|
||||||
|
@ -37,6 +31,7 @@ function addAPI(methods) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* exported createCache */
|
||||||
/** Creates a FIFO limit-size map. */
|
/** Creates a FIFO limit-size map. */
|
||||||
function createCache({size = 1000, onDeleted} = {}) {
|
function createCache({size = 1000, onDeleted} = {}) {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user