chore: format

This commit is contained in:
Lhcfl 2024-03-21 18:00:32 +08:00
parent 5dc313d6d1
commit 17a42f015a

View file

@ -1016,7 +1016,10 @@ function deleteDraft() {
* @returns false if they are close enough
*/
function isSameLanguage(langCode1: string | null, langCode2: string | null) {
return languageContains(langCode1, langCode2) || languageContains(langCode2, langCode1);
return (
languageContains(langCode1, langCode2) ||
languageContains(langCode2, langCode1)
);
}
/**
@ -1025,15 +1028,14 @@ function isSameLanguage(langCode1: string | null, langCode2: string | null) {
function languageContains(langCode1: string | null, langCode2: string | null) {
if (!langCode1 || !langCode2) return false;
if (langCode1 === "zh" &&
if (
langCode1 === "zh" &&
["zh-hant", "zh-hans", "yue", "nan"].includes(langCode2)
) {
return true;
}
if (langCode1 === "no" &&
["nb", "nn"].includes(langCode2)
) {
if (langCode1 === "no" && ["nb", "nn"].includes(langCode2)) {
return true;
}
return false;