@intlayer/chokidar
Version:
Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.
18 lines (16 loc) • 1.36 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
let node_path = require("node:path");
let _intlayer_config_logger = require("@intlayer/config/logger");
let _intlayer_config_colors = require("@intlayer/config/colors");
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
let _intlayer_config_built = require("@intlayer/config/built");
let _intlayer_core_localization = require("@intlayer/core/localization");
let _intlayer_types_locales = require("@intlayer/types/locales");
//#region src/utils/formatter.ts
const formatPath = (path, color) => [path].flat().map((path) => path.startsWith("/") ? (0, node_path.relative)(_intlayer_config_built.system.baseDir, path) : path).map((relativePath) => color === false ? relativePath : (0, _intlayer_config_logger.colorizePath)(relativePath, color)).join(`, `);
const formatLocale = (locale, color = _intlayer_config_colors.GREEN) => [locale].flat().map((locale) => `${(0, _intlayer_core_localization.getLocaleName)(locale, _intlayer_types_locales.ENGLISH)} (${locale})`).map((text) => color === false ? text : (0, _intlayer_config_logger.colorize)(text, color)).join(`, `);
//#endregion
exports.formatLocale = formatLocale;
exports.formatPath = formatPath;
//# sourceMappingURL=formatter.cjs.map