diff options
Diffstat (limited to 'ext/js/language/languages.js')
-rwxr-xr-x | ext/js/language/languages.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ext/js/language/languages.js b/ext/js/language/languages.js index 4b196c2c..b3890aa6 100755 --- a/ext/js/language/languages.js +++ b/ext/js/language/languages.js @@ -29,21 +29,29 @@ export function getLanguageSummaries() { } /** - * @returns {import('language').LanguageAndPreprocessors[]} + * @returns {import('language').LanguageAndProcessors[]} * @throws {Error} */ -export function getAllLanguageTextPreprocessors() { +export function getAllLanguageTextProcessors() { const results = []; - for (const {iso, textPreprocessors} of languageDescriptorMap.values()) { - /** @type {import('language').TextPreprocessorWithId<unknown>[]} */ + for (const {iso, textPreprocessors = {}, textPostprocessors = {}} of languageDescriptorMap.values()) { + /** @type {import('language').TextProcessorWithId<unknown>[]} */ const textPreprocessorsArray = []; for (const [id, textPreprocessor] of Object.entries(textPreprocessors)) { textPreprocessorsArray.push({ id, - textPreprocessor: /** @type {import('language').TextPreprocessor<unknown>} */ (textPreprocessor) + textProcessor: /** @type {import('language').TextProcessor<unknown>} */ (textPreprocessor) }); } - results.push({iso, textPreprocessors: textPreprocessorsArray}); + /** @type {import('language').TextProcessorWithId<unknown>[]} */ + const textPostprocessorsArray = []; + for (const [id, textPostprocessor] of Object.entries(textPostprocessors)) { + textPostprocessorsArray.push({ + id, + textProcessor: /** @type {import('language').TextProcessor<unknown>} */ (textPostprocessor) + }); + } + results.push({iso, textPreprocessors: textPreprocessorsArray, textPostprocessors: textPostprocessorsArray}); } return results; } |