Fix eslint issues
This commit is contained in:
parent
508f71f26b
commit
0037c699d9
975
edit/edit.js
975
edit/edit.js
File diff suppressed because it is too large
Load Diff
|
@ -12,6 +12,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection])
|
||||||
}
|
}
|
||||||
|
|
||||||
// add favicon in Firefox
|
// add favicon in Firefox
|
||||||
|
// eslint-disable-next-line no-unused-expressions
|
||||||
navigator.userAgent.includes('Firefox') && setTimeout(() => {
|
navigator.userAgent.includes('Firefox') && setTimeout(() => {
|
||||||
const iconset = ['', 'light/'][prefs.get('iconset')] || '';
|
const iconset = ['', 'light/'][prefs.get('iconset')] || '';
|
||||||
for (const size of [38, 32, 19, 16]) {
|
for (const size of [38, 32, 19, 16]) {
|
||||||
|
|
|
@ -128,8 +128,11 @@ function showStyles(styles = []) {
|
||||||
function renderStyles() {
|
function renderStyles() {
|
||||||
const t0 = performance.now();
|
const t0 = performance.now();
|
||||||
let rendered = 0;
|
let rendered = 0;
|
||||||
while (index < sorted.length
|
while (
|
||||||
&& (shouldRenderAll || ++rendered < 10 || performance.now() - t0 < 10)) {
|
index < sorted.length &&
|
||||||
|
// eslint-disable-next-line no-unmodified-loop-condition
|
||||||
|
(shouldRenderAll || ++rendered < 10 || performance.now() - t0 < 10)
|
||||||
|
) {
|
||||||
renderBin.appendChild(createStyleElement(sorted[index++]));
|
renderBin.appendChild(createStyleElement(sorted[index++]));
|
||||||
}
|
}
|
||||||
filterAndAppend({container: renderBin});
|
filterAndAppend({container: renderBin});
|
||||||
|
@ -976,9 +979,14 @@ function objectDiff(first, second, path = '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (a && typeof a.filter == 'function' && b && typeof b.filter == 'function') {
|
if (a && typeof a.filter == 'function' && b && typeof b.filter == 'function') {
|
||||||
if (a.length != b.length
|
if (
|
||||||
|| a.some((el, i) => !el || typeof el != 'object' ? el != b[i]
|
a.length != b.length ||
|
||||||
: objectDiff(el, b[i], path + key + '[' + i + '].').length)
|
a.some((el, i) => {
|
||||||
|
const result = !el || typeof el != 'object'
|
||||||
|
? el != b[i]
|
||||||
|
: objectDiff(el, b[i], path + key + '[' + i + '].').length;
|
||||||
|
return result;
|
||||||
|
})
|
||||||
) {
|
) {
|
||||||
diff.push({path, key, values: [a, b], type: 'changed'});
|
diff.push({path, key, values: [a, b], type: 'changed'});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user