(config: AppConfig)
| 37 | |
| 38 | // dev only |
| 39 | export function installLegacyConfigWarnings(config: AppConfig): void { |
| 40 | const legacyConfigOptions: Record<string, DeprecationTypes> = { |
| 41 | silent: DeprecationTypes.CONFIG_SILENT, |
| 42 | devtools: DeprecationTypes.CONFIG_DEVTOOLS, |
| 43 | ignoredElements: DeprecationTypes.CONFIG_IGNORED_ELEMENTS, |
| 44 | keyCodes: DeprecationTypes.CONFIG_KEY_CODES, |
| 45 | productionTip: DeprecationTypes.CONFIG_PRODUCTION_TIP, |
| 46 | } |
| 47 | |
| 48 | Object.keys(legacyConfigOptions).forEach(key => { |
| 49 | let val = (config as any)[key] |
| 50 | Object.defineProperty(config, key, { |
| 51 | enumerable: true, |
| 52 | get() { |
| 53 | return val |
| 54 | }, |
| 55 | set(newVal) { |
| 56 | if (!isCopyingConfig) { |
| 57 | warnDeprecation(legacyConfigOptions[key], null) |
| 58 | } |
| 59 | val = newVal |
| 60 | }, |
| 61 | }) |
| 62 | }) |
| 63 | } |
| 64 | |
| 65 | export function installLegacyOptionMergeStrats(config: AppConfig): void { |
| 66 | config.optionMergeStrategies = new Proxy({} as any, { |
no test coverage detected