mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-25 07:43:01 +01:00
Prettier applied to whole project, prettier added to pre-commit hook
This commit is contained in:
1 parent
47517ce0bd
commit
b133adeecb
59 files changed
+912
-819
No files matched your search
@@ -1,9 +1,7 @@
|
||||
import { extConfig } from "./state";
|
||||
|
||||
function numberFormat(numberState) {
|
||||
return getNumberFormatter(extConfig.numberDisplayFormat).format(
|
||||
numberState
|
||||
);
|
||||
return getNumberFormatter(extConfig.numberDisplayFormat).format(numberState);
|
||||
}
|
||||
|
||||
function getNumberFormatter(optionSelect) {
|
||||
@@ -17,11 +15,11 @@ function getNumberFormatter(optionSelect) {
|
||||
userLocales = new URL(
|
||||
Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||
?.getAttribute("href")
|
||||
?.getAttribute("href"),
|
||||
)?.searchParams?.get("locale");
|
||||
} catch {
|
||||
cLog(
|
||||
"Cannot find browser locale. Use en as default for number formatting."
|
||||
"Cannot find browser locale. Use en as default for number formatting.",
|
||||
);
|
||||
userLocales = "en";
|
||||
}
|
||||
@@ -168,8 +166,12 @@ function createObserver(options, callback) {
|
||||
const observerWrapper = new Object();
|
||||
observerWrapper.options = options;
|
||||
observerWrapper.observer = new MutationObserver(callback);
|
||||
observerWrapper.observe = function (element) { this.observer.observe(element, this.options); }
|
||||
observerWrapper.disconnect = function () { this.observer.disconnect(); }
|
||||
observerWrapper.observe = function (element) {
|
||||
this.observer.observe(element, this.options);
|
||||
};
|
||||
observerWrapper.disconnect = function () {
|
||||
this.observer.disconnect();
|
||||
};
|
||||
return observerWrapper;
|
||||
}
|
||||
|
||||
@@ -184,5 +186,5 @@ export {
|
||||
localize,
|
||||
querySelector,
|
||||
querySelectorAll,
|
||||
createObserver
|
||||
createObserver,
|
||||
};
|
||||
Reference in new issue
Block a user