UNPKG

@o3r/localization

Version:

This module provides a runtime dynamic language/translation support and debug tools.

22 lines 903 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.updateV116 = void 0; const schematics_1 = require("@o3r/schematics"); const regexp = /translations\s*:\s*(?:Readonly<)?([A-Z][\w]*)(?:>)?\s*=\s*({[^;]+})\s*(as\s*const)?\s*;/g; function updateV116Fn() { return (tree) => { const files = (0, schematics_1.findFilesInTree)(tree.getDir(''), (filePath) => /translation\.ts$/.test(filePath)); files.forEach(({ content, path }) => { const str = content.toString(); const newContent = str.replaceAll(regexp, 'translations: Readonly<$1> = $2 as const;'); if (newContent !== str) { tree.overwrite(path, newContent); } }); }; } /** * Update of Otter configuration V11.6 */ exports.updateV116 = (0, schematics_1.createOtterSchematic)(updateV116Fn); //# sourceMappingURL=index.js.map