Skip to content

Commit

Permalink
fix: standard js lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed Jun 27, 2023
1 parent d269f14 commit 1bd2499
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tts/BrowserTTS.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,10 @@ const updateVoices = ({ locale, onError }) => {
// as they provide a coherent
if (filteredVoices.length > 0) {
return selectVoice(getBestMatch(filteredVoices))
}


} else {
// Step 1: no voice found for the current locale
// --> make regex pattern that fits locale
// --> search voices for pattern
else {
// --> search voices for pattern
const localePrefix = (locale || '').toLowerCase().split(/[-_]/)[0]
const prefixMinus = `${localePrefix}-`
const prefixUnderscore = `${localePrefix}_`
Expand All @@ -170,8 +167,7 @@ const updateVoices = ({ locale, onError }) => {

if (filteredVoices.length > 0) {
return selectVoice(getBestMatch(filteredVoices))
}
else {
} else {
const details = {
locale,
localePrefix,
Expand All @@ -186,4 +182,4 @@ const updateVoices = ({ locale, onError }) => {
: console.error(voiceNotFoundError)
}
}
}
}

0 comments on commit 1bd2499

Please sign in to comment.