(db: Db, filepath: string)
| 475 | } |
| 476 | |
| 477 | async function _handleTranslationFileDeleted(db: Db, filepath: string): Promise<void> { |
| 478 | const lang = getLocaleFromFilepath(filepath); |
| 479 | if (!lang) return; |
| 480 | const filename = filepath.split('/').pop()!; |
| 481 | const indexName = getIndexName(filename); |
| 482 | if (!indexName) return; |
| 483 | |
| 484 | const collectionPrefix = getCollectionPrefix(filepath); |
| 485 | const translationCollection = db.collection(`${collectionPrefix}translations`); |
| 486 | |
| 487 | console.log(`\nProcessing Deleted translation ${filepath}...`); |
| 488 | const result = await translationCollection.deleteMany({ source_collection: indexName, lang }); |
| 489 | console.log(` Deleted ${result.deletedCount} translation documents.`); |
| 490 | |
| 491 | await _refreshLocaleStatsForLang(db, filepath, lang); |
| 492 | } |
| 493 | |
| 494 | // --- Main Processor Function --- |
| 495 |
no test coverage detected