web: improve error handling

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-29 18:18:25 +02:00
parent 372cf4a8cb
commit 5b8e3b4189
2 changed files with 13 additions and 10 deletions

View File

@ -51,3 +51,8 @@ export function loading<T>(v: T, actual: TemplateResult): TemplateResult {
}
return actual;
}
export function camelToSnake(key: string): string {
var result = key.replace(/([A-Z])/g, " $1");
return result.split(' ').join('_').toLowerCase();
}