UNPKG

@o3r/configuration

Version:

This module contains configuration-related features such as CMS compatibility, Configuration override, store and debugging. It enables your application runtime configuration and comes with an integrated ng builder to help you generate configurations suppo

22 lines 902 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.updateV116 = void 0; const schematics_1 = require("@o3r/schematics"); const regexp = /DEFAULT_CONFIG\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) => /config\.ts$/.test(filePath)); files.forEach(({ content, path }) => { const str = content.toString(); const newContent = str.replaceAll(regexp, 'DEFAULT_CONFIG: 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