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

Commit

Permalink
Deprecate camelCase config options (#11261)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jul 14, 2023
1 parent 77c3a89 commit 3a784c7
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 3a784c7

Please sign in to comment.