mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 11:51:36 +02:00
Deprecate camelCase config options (#11261)
This commit is contained in:
parent
77c3a89cbc
commit
3a784c71e8
@ -25,7 +25,15 @@ export class SnakedObject<T = Record<string, any>> {
|
||||
const val = this.obj[key];
|
||||
if (val !== undefined) return val;
|
||||
|
||||
return this.obj[<K>(altCaseName ?? snakeToCamel(key))];
|
||||
const fallbackKey = altCaseName ?? snakeToCamel(key);
|
||||
const fallback = this.obj[<K>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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user