Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Dec 20, 2023
1 parent 449218c commit 8c60235
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/titles/titleFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export async function toTitleCase(str: string, isCustom: boolean): Promise<strin
// For custom titles, allow any not just first capital
// For non-custom, allow any that isn't all caps
result += word + " ";
} else if ((!Config.config!.onlyTitleCaseInEnglish || isEnglish)
} else if ((!Config.config?.onlyTitleCaseInEnglish || isEnglish)
&& !startOfSentence(index, words) && listHasWord(titleCaseNotCapitalized, word.toLowerCase())) {
// Skip lowercase check for the first word
result += await toLowerCase(word, isTurkiq) + " ";
Expand Down Expand Up @@ -371,7 +371,7 @@ async function getLangInfo(str: string): Promise<{
// Helps remove false positives
isEnglish: !(!result.results[3]
&& result.isReliable
&& Config.config!.onlyTitleCaseInEnglish // Only do further checks if enabled
&& Config.config?.onlyTitleCaseInEnglish // Only do further checks if enabled
&& result.topLanguage === ((await checkLanguages(str.replace(/[^ ]+$/, ""), [], threshold)).topLanguage))
}
}
Expand Down

0 comments on commit 8c60235

Please sign in to comment.