From 3a784c71e882e9041a259baa9633993b89caf26b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 14 Jul 2023 11:50:52 +0100 Subject: [PATCH] Deprecate camelCase config options (#11261) --- src/utils/SnakedObject.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/SnakedObject.ts b/src/utils/SnakedObject.ts index 1f6770c487..090faf1bde 100644 --- a/src/utils/SnakedObject.ts +++ b/src/utils/SnakedObject.ts @@ -25,7 +25,15 @@ export class SnakedObject> { const val = this.obj[key]; if (val !== undefined) return val; - return this.obj[(altCaseName ?? snakeToCamel(key))]; + const fallbackKey = altCaseName ?? snakeToCamel(key); + const fallback = this.obj[fallbackKey]; + if (!!fallback) { + console.warn(`Using deprecated camelCase config ${fallbackKey}`); + console.warn( + "See https://github.com/vector-im/element-web/blob/develop/docs/config.md#-deprecation-notice", + ); + } + return fallback; } // Make JSON.stringify() pretend that everything is fine