Enable no-unsafe-negation lint

This actually fixes a bug--the old code was negating "audioData.type"
This commit is contained in:
valadaptive 2023-12-02 09:17:16 -05:00
parent 7def71aef7
commit c05aee8e72
2 changed files with 1 additions and 2 deletions

View File

@ -65,7 +65,6 @@ module.exports = {
'no-case-declarations': 'off',
'use-isnan': 'off',
'no-self-assign': 'off',
'no-unsafe-negation': 'off',
'no-constant-condition': ['error', {checkLoops: false}]
}
};

View File

@ -425,7 +425,7 @@ function completeCurrentAudioJob() {
*/
async function addAudioJob(response) {
const audioData = await response.blob()
if (!audioData.type in ['audio/mpeg', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/webm']) {
if (!(audioData.type in ['audio/mpeg', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/webm'])) {
throw `TTS received HTTP response with invalid data format. Expecting audio/mpeg, got ${audioData.type}`
}
audioJobQueue.push(audioData)