A tool for parsing traffic on the jetstream and applying a moderation workstream based on regexp based rules

Minor fixes

Changed files
+12 -11
src
+3 -4
src/checkPosts.ts
··· 51 51 (postCheck) => postCheck.label === label, 52 52 ); 53 53 54 - if (checkPost.language || checkPost.language === undefined) { 54 + if (checkPost?.language || checkPost?.language !== undefined) { 55 55 if (!checkPost?.language.includes(lang)) { 56 - logger.info( 57 - `[CHECKPOSTS]: ${checkPost!.label} not supported in ${lang}`, 58 - ); 59 56 return; 57 + } else { 58 + logger.info(`[CHECKPOSTS]: ${checkPost!.label} supported for ${lang}`); 60 59 } 61 60 } 62 61
+8 -6
src/checkProfiles.ts
··· 27 27 (profileCheck) => profileCheck.label === label, 28 28 ); 29 29 30 - if (checkProfiles.language || checkProfiles.language === undefined) { 30 + if (checkProfiles?.language || checkProfiles?.language !== undefined) { 31 31 if (!checkProfiles?.language.includes(lang)) { 32 + return; 33 + } else { 32 34 logger.info( 33 - `[CHECKDESCRIPTION]: ${checkProfiles!.label} not supported for ${lang}`, 35 + `[CHECKDESCRIPTION]: ${checkProfiles!.label} supported for ${lang}`, 34 36 ); 35 - return; 36 37 } 37 38 } 38 39 ··· 111 112 (profileCheck) => profileCheck.label === label, 112 113 ); 113 114 114 - if (checkProfiles.language || checkProfiles.language === undefined) { 115 + if (checkProfiles?.language || checkProfiles?.language !== undefined) { 115 116 if (!checkProfiles?.language.includes(lang)) { 117 + return; 118 + } else { 116 119 logger.info( 117 - `[CHECKDESCRIPTION]: ${checkProfiles!.label} not supported for ${lang}`, 120 + `[CHECKDESCRIPTION]: ${checkProfiles!.label} supported for ${lang}`, 118 121 ); 119 - return; 120 122 } 121 123 } 122 124
+1 -1
src/types.ts
··· 1 1 export interface Checks { 2 - language?: string; 2 + language?: string[]; 3 3 label: string; 4 4 comment: string; 5 5 description?: boolean;