mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
fixed email template not loading bug
This commit is contained in:
parent
8e8a1b1be1
commit
5b2a851f98
@ -124,10 +124,12 @@ export function mergeScopeStrings(...scopes: string[]): string {
|
||||
|
||||
|
||||
export function snakeCaseToCamelCase(snakeCase: string): string {
|
||||
if (snakeCase.match(/[A-Z]/)) return snakeCase; // TODO: this is a hack for fixing the email templates, remove this after v2 migration
|
||||
return snakeCase.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
||||
}
|
||||
|
||||
export function camelCaseToSnakeCase(camelCase: string): string {
|
||||
if (camelCase.match(/_/)) return camelCase; // TODO: this is a hack for fixing the email templates, remove this after v2 migration
|
||||
return camelCase.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user