this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove trimming feature; UNKNOWN -> unknown

alice c2e1f6f5 7e9c035d

+3 -9
-1
packages/backend/src/config.ts
··· 7 7 export const MAX_TOP_LANGUAGES = 30; 8 8 export const EMIT_INTERVAL = 1000; 9 9 export const LOG_INTERVAL = 10 * 1000; 10 - export const TRIM_LANGUAGE_CODES = false; 11 10 export const CURSOR_UPDATE_INTERVAL = 10 * 1000; 12 11 export const REDIS_URL = process.env.REDIS_URL ?? 'redis://localhost:6379'; 13 12 export const PORT = process.env.PORT ?? '3100';
+3 -8
packages/backend/src/lib/emojiStats.ts
··· 2 2 import emojiRegexFunc from 'emoji-regex'; 3 3 import fs from 'fs'; 4 4 5 - import { MAX_EMOJIS, MAX_TOP_LANGUAGES, TRIM_LANGUAGE_CODES } from '../config.js'; 5 + import { MAX_EMOJIS, MAX_TOP_LANGUAGES } from '../config.js'; 6 6 import { batchNormalizeEmojis } from './emojiNormalization.js'; 7 7 import logger from './logger.js'; 8 8 import { ··· 42 42 try { 43 43 let langs = new Set<string>(); 44 44 if (record.langs && Array.isArray(record.langs)) { 45 - langs = new Set( 46 - record.langs.map((lang: string) => 47 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition 48 - TRIM_LANGUAGE_CODES ? lang.split('-')[0].toLowerCase().slice(0, 2) : lang, 49 - ), 50 - ); 45 + langs = new Set(record.langs); 51 46 } else { 52 - langs.add('UNKNOWN'); 47 + langs.add('unknown'); 53 48 } 54 49 55 50 const emojiMatches: string[] = record.text.match(emojiRegex) ?? [];