UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

27 lines (25 loc) 1.38 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('../_virtual/_rolldown/runtime.cjs'); const require_utils_autoDecorateContent = require('../utils/autoDecorateContent.cjs'); const require_utils_resolveObjectPromises = require('../utils/resolveObjectPromises.cjs'); let _intlayer_config_logger = require("@intlayer/config/logger"); //#region src/buildIntlayerDictionary/processContentDeclaration.ts /** * Function to load, process the module and return the Intlayer Dictionary from the module file */ const processContentDeclaration = async (contentDeclaration, configuration) => { try { const resolvedContent = await require_utils_resolveObjectPromises.resolveObjectPromises(contentDeclaration.content); const isAutoDecorateContentEnabled = contentDeclaration.contentAutoTransformation ?? configuration.dictionary?.contentAutoTransformation ?? false; const decoratedContent = isAutoDecorateContentEnabled ? require_utils_autoDecorateContent.autoDecorateContent(resolvedContent, isAutoDecorateContentEnabled) : resolvedContent; return { ...contentDeclaration, content: decoratedContent }; } catch (error) { (0, _intlayer_config_logger.logger)(error, { level: "error" }); } }; //#endregion exports.processContentDeclaration = processContentDeclaration; //# sourceMappingURL=processContentDeclaration.cjs.map