diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-24 23:47:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 04:47:57 +0000 |
commit | 73169f06dff767020718a5715eba97d3575ba7e1 (patch) | |
tree | 99d458f9d2ca74e67dbb4bccd148ef549f7ce2cf /ext/js/language/translator.js | |
parent | a21948daf6210f67955ae4f98a81e21b8cf9f1f2 (diff) |
Turn on @typescript-eslint/no-unsafe-argument (#728)24.2.26.0
Diffstat (limited to 'ext/js/language/translator.js')
-rw-r--r-- | ext/js/language/translator.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index 568c12bd..b10af226 100644 --- a/ext/js/language/translator.js +++ b/ext/js/language/translator.js @@ -137,6 +137,7 @@ export class Translator { text = this._getJapaneseOnlyText(text); } const {enabledDictionaryMap} = options; + /** @type {Set<string>} */ const kanjiUnique = new Set(); for (const c of text) { kanjiUnique.add(c); @@ -702,6 +703,7 @@ export class Translator { * @returns {import('dictionary').TermDictionaryEntry[]} */ _groupDictionaryEntriesByHeadword(dictionaryEntries, tagAggregator) { + /** @type {Map<string, import('dictionary').TermDictionaryEntry[]>} */ const groups = new Map(); for (const dictionaryEntry of dictionaryEntries) { const {inflectionRuleChainCandidates, headwords: [{term, reading}]} = dictionaryEntry; @@ -1039,8 +1041,11 @@ export class Translator { * @param {TranslatorTagAggregator} tagAggregator */ async _addTermMeta(dictionaryEntries, enabledDictionaryMap, tagAggregator) { + /** @type {Map<string, Map<string, {headwordIndex: number, pronunciations: import('dictionary').TermPronunciation[], frequencies: import('dictionary').TermFrequency[]}[]>>} */ const headwordMap = new Map(); + /** @type {string[]} */ const headwordMapKeys = []; + /** @type {Map<string, {headwordIndex: number, pronunciations: import('dictionary').TermPronunciation[], frequencies: import('dictionary').TermFrequency[]}[]>[]} */ const headwordReadingMaps = []; for (const {headwords, pronunciations, frequencies} of dictionaryEntries) { |