Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Deprecate camelCase config options #11261

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/utils/SnakedObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading