mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-13 15:36:42 +08:00
fixed lint warnings
This commit is contained in:
parent
c00ca940ec
commit
65f1143158
1 changed files with 4 additions and 16 deletions
|
@ -1,5 +1,4 @@
|
|||
import * as Loader from "./loader";
|
||||
import axiosInstance from "./axios-instance";
|
||||
import Config from "./config";
|
||||
|
||||
export function getuid() {
|
||||
|
@ -266,10 +265,6 @@ export function showNotification(text, time) {
|
|||
}
|
||||
|
||||
let currentLanguage;
|
||||
export async function getCurrentLanguage() {
|
||||
return await getLanguage(Config.language);
|
||||
}
|
||||
|
||||
export async function getLanguage(lang) {
|
||||
try {
|
||||
if (currentLanguage == null || currentLanguage.name !== lang) {
|
||||
|
@ -290,6 +285,10 @@ export async function getLanguage(lang) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function getCurrentLanguage() {
|
||||
return await getLanguage(Config.language);
|
||||
}
|
||||
|
||||
export function migrateFromCookies() {
|
||||
["resultFilters", "config", "merchbannerclosed", "activeTags"].forEach(
|
||||
function (name) {
|
||||
|
@ -755,17 +754,6 @@ export function setCharAt(str, index, chr) {
|
|||
return str.substring(0, index) + chr + str.substring(index + 1);
|
||||
}
|
||||
|
||||
//https://www.reddit.com/r/learnjavascript/comments/8ohug3/how_to_recursively_count_keys_in_an_object/e03fytn/
|
||||
function countAllKeys(obj) {
|
||||
if (typeof obj !== "object" || obj === null) {
|
||||
return 0;
|
||||
}
|
||||
const keys = Object.keys(obj);
|
||||
let sum = keys.length;
|
||||
keys.forEach((key) => (sum += countAllKeys(obj[key])));
|
||||
return sum;
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/questions/273789/is-there-a-version-of-javascripts-string-indexof-that-allows-for-regular-expr
|
||||
export function regexIndexOf(string, regex, startpos) {
|
||||
var indexOf = string.substring(startpos || 0).search(regex);
|
||||
|
|
Loading…
Reference in a new issue