1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Replace deprecated String.prototype.substr() (#2298)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot
2022-04-14 23:23:27 +02:00
committed by GitHub
parent fbe81ad823
commit cde935629d
7 changed files with 20 additions and 20 deletions

View File

@@ -427,7 +427,7 @@ export function globToRegexp(glob: string, extended?: any): string {
export function ensureNoTrailingSlash(url: string): string {
if (url && url.endsWith("/")) {
return url.substr(0, url.length - 1);
return url.slice(0, -1);
} else {
return url;
}